Make an orbit

I am using WPF and mainly C# only as my assignment says, I am a beginner in WPF and I have drawn, the sun, and earth on the screen. However how can I make the earth move in a circular motion? I know this is very vague but some assistance on where I should start would be useful. Thanks!
8 Replies
Pobiega
Pobiega10mo ago
how did you draw the earth? how is it positioned?
Gabiel Thanos Vozimov
here is my code https://codeshare.io/J7rYOE I have a canvas with a height of 500, and width of 800 i placed the sun in the middle (i think) and earth 200 pixels away from the left the part at the end with the dispatch timer is not relevant, i was just testing it out to see how it works
Pobiega
Pobiega10mo ago
well, theres guaranteed to be a math equation that gives you an elliptical rotation around a given point so use a timer, run that equation and move the planet
Gabiel Thanos Vozimov
how would i move the planet? using Canvas.SetLeft() ?
Pobiega
Pobiega10mo ago
$tias
Pobiega
Pobiega10mo ago
probably yes
Gabiel Thanos Vozimov
ok thanks
Want results from more Discord servers?
Add your server