Circle calculation

Started by
3 comments, last by Dmytry 19 years, 4 months ago
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 :)
We can forgive a man for making a useful thing as long as he does not admire it. The only excuse for making a useless thing is that one admires it intensely.-- ? --
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.
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]
We can forgive a man for making a useful thing as long as he does not admire it. The only excuse for making a useless thing is that one admires it intensely.-- ? --
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.
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))

This topic is closed to new replies.

Advertisement