You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
670 B

2 years ago
2 years ago
function draw_roulette(nb_person, x, y){
let angle = 0;
for (let i=0; i < 1; i++){
let coo_arr = new Array(250 - 50 * Math.cos(2 * Math.PI / nb_person), 200 - 50 * Math.sin(2 * Math.PI / nb_person));
2 years ago
let svg = document.createElement('svg');
svg.setAttribute("width", 800);
svg.setAttribute('height', 800);
2 years ago
let new_path = document.createElement("path");
new_path.setAttribute('fill', 'green');
new_path.setAttribute('d', "M 200 200 A 50 50 0 0 1 " + coo_arr[0] + " " + coo_arr[1] + " L 250 200 Z");
2 years ago
svg.appendChild(new_path);
document.getElementsByTag('body')[0].appendChild(svg);
console.log(svg)
2 years ago
console.log(new_path.getAttribute('d'));
2 years ago
}
2 years ago
};