'Rotate circles around center point like a Solar System (Java Script)
I am working on a project as I try to learn Java Script. I managed to make the circles and a center point. I have tried using things like the rotate command, which may be completely off course, but I am trying to make the circles move in a circle around the center point/dot like a solar system would. I would also like to be able to change the speed for each circle. If possible so I can get a better understanding of setting the center point how could I make another object near one of the circles and have it rotate around the center of that circle?
My current program looks like this (I am using Khan Academy)
var x=0;
var y=0;
draw = function() {
background(255);
strokeWeight(5);
point(200,200);
strokeWeight(2);
ellipse(x+250,y+250,50,50);
ellipse(x+75,y+200,100,100);
ellipse(x+125,y+125,25,25);
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
