Jump to content
  • Advertisement
Sign in to follow this  
Mexx Cuter

Circle calculation

This topic is 5125 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

Hi iam not that good in math, doing my best to get better. so i got a question about a circle and a graphic x,y. if i got a point on 5,0(x,y) and i would like to get 20 degrees up/left how could i calculate the new point? hope iam clear and it doesn't sound like rubisch :)

Share this post


Link to post
Share on other sites
Advertisement
what is new point? Should it be placed on circle? On what circle exactly?
What is 20 degrees up left?

Or you want to turn your point conterclockwise by 20 degrees?
In second case, rotation is given by
5*cos(20)-0*sin(20)
5*sin(20)+0*cos(20)

of course 0*something=0

edit: and rotation is around origin.

Share this post


Link to post
Share on other sites
thank you so far for the information.

i ment radius of 5, center is on 0,0. and move 20 degrees then both directions are actually fine.

am i giving enough information or am i missing something?


Edit:
what i got now is.

po = 0,5
radius is 5
moving on the (x,y) 45 degrees is.
5 * cos(45) = x
5 * sin(45) = y
then i have the new x,y position.

[Edited by - Mexx Cuter on November 27, 2004 9:24:20 AM]

Share this post


Link to post
Share on other sites
Dude, I've added you to my MSN contact list - all you need to do is to log-in and talk to me, I'll explain it to you personally :).
By the way, this's my msn adress, feel free to add me if you blocked me or deleted me from some reason: ariyes@bezeqint.net .
Yours, Arie.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mexx Cuter
thank you so far for the information.

i ment radius of 5, center is on 0,0. and move 20 degrees then both directions are actually fine.

am i giving enough information or am i missing something?


Edit:
what i got now is.

po = 0,5
radius is 5
moving on the (x,y) 45 degrees is.
5 * cos(45) = x
5 * sin(45) = y
then i have the new x,y position.

It's usually called turning around zero. Yes, your formule is right, and will be right for 20 degrees too.

edit: if your actual *code* is like that, it will not work. In most programming languages, sin & cos take angle in radians. You need to use
sin(angle*(pi/180.0))
and
cos(angle*(pi/180.0))

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!