Jump to content
  • Advertisement
Sign in to follow this  

Calculating coordinates.

This topic is 2923 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I'm designing a system map for a space sim game. The obrbital bodies should rotate around the star. And it takes time for the player to travel between orbital bodies.

However i never really worked with sinus and cosinus before and i could use some help.

So in my database i would fetch the distance from the sun and the angle and with that data i should be able to position the body in a X,y coordinate system using sinus and cosinus right?

I tried something like this:


Planet – Distance from sun is 20 angle is 45 degree

Planet X = (cos(45) * 20) + sunX = 10.5
Planet Y = (Sin(45) * 20) + sunY = 17.0

Obviously i'm doing something wrong, as they should both be the same number. and autocad tells me the position of the planet should be roughly X=14.1, Y=14.1.

Also my game will be browser based and i was wondering how heave the load would be to keep calculating the position of each orbital body for each player each couple of minutes.

Share this post

Link to post
Share on other sites
Yeah obviously i just found that here http://groups.google.com/group/irobot-create-forum/web/calculate-x-y-coordinates-with-distance-and-angle-sensor-data :D.

I already tried using gon wich i thought was more logical to use but didn't work.

Anyway thanks i think i can figure it out now.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!