# 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.

## Recommended Posts

Hi,

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:

sunX=0
sunY=0

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 on other sites
Use radians and it will all make sense.

##### 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.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632998
• Total Posts
3009808
• ### Who's Online (See full list)

There are no registered users currently online

×