# coordinate conversion

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

## Recommended Posts

I was wondering how i could convert rectangulare coordinates by 45 degress to the right. I do not want to move anything i just want to convert a point at 100,50 in rectangulare coordinates into a rectangulare coordinate system rotated by 45 degrees. this is what i found x1,y1 are the new coordinates and x,y are the current coordinates x1 = x*cos(45) + y*sin(45); y1 = -x*sin(45) + y*cos(45); for some reason that equation actually moves the point. I maybe doing some thing wrong in my code but i don't think that equation is right. thanks for any help that can be provided.

##### Share on other sites
so let me get this straight, this is liken a tilted grid?

##### Share on other sites
An old equation that I used for an old project was:

x1 = cos(theta)*x - sin(theta)*y;
y1 = sin(theta)*x + cos(theta)*y;

Also, I don't think that works when you are working with degrees, might need to use radians but cant remember :/

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 14
• 14
• 45
• 22
• 27
• ### Forum Statistics

• Total Topics
634044
• Total Posts
3015211
×