From 7f0dc2beaa8bf609d46b13e95d7ea5780c6f7932 Mon Sep 17 00:00:00 2001 From: quegzacov Date: Tue, 27 Dec 2022 20:14:09 +0100 Subject: [PATCH] 3.141592653589793238 --- index.php | 6 ++++-- script.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 97ff08a..fc763cc 100755 --- a/index.php +++ b/index.php @@ -16,9 +16,11 @@ var_dump($res); ?> - + + + diff --git a/script.js b/script.js index 9391750..be89685 100755 --- a/script.js +++ b/script.js @@ -1,10 +1,10 @@ function draw_roulette(nb_person, x, y){ - let chart = document.getElementById("roulette") + let chart = document.getElementById("roulette").querySelector('g')[0]; let starting_coo= new Array(x, y); let angle = 0; for (let i=0; i < nb_person; i++){ - let coo_arr = new Array(250 - 50 * Math.cos(2 * Math.PI / nb_person) * (i+1), 200 - 50 * Math.sin(2 * Math.PI / nb_person) * (i+1)); + let coo_arr = new Array(250 - 50 * Math.cos(2 * Math.PI / nb_person * (i+1)), 200 - 50 * Math.sin(2 * Math.PI / nb_person * (i+1))); let new_path = document.createElement("path"); new_path.setAttribute('fill', 'green'); new_path.setAttribute('d', "M " + starting_coo[0] + " " + starting_coo[1] + " A 50 50 0 0 1 " + coo_arr[0] + " " + coo_arr[1] + " L 250 200 Z");