PDA

View Full Version : OT: Maths question



Archeus
10-07-04, 10:17
Sorry if it's a noob question. :) (been a while)

Lets say you know the center of a circle Cx/Cy and the radius R and the X/Y point of a point on the cirle. How do you determine the angle of the line from Cx/Cy to X/Y?

Maloch Octavia
10-07-04, 10:22
Go do your own homework ya nib. :P

Dominion
10-07-04, 10:22
Trig is your friend ... but Dominion has been on summer vacation and doesn't remember his trig.

Archeus
10-07-04, 11:37
Go do your own homework ya nib. :P

Its not homework, writing a program to do something but requires some things I can't remember the formulas for.

I know X/Y = Cos(angle)/Sin(angle) . Just not sure the reverse.

Richard Slade
10-07-04, 12:50
Whenever you find something that you don't know the answer of,
be aware of the fact that 42 might be the solution

P4mp3rk3
10-07-04, 13:01
sin(x) = Y/R

x = arcsin(Y/R)

tadaaam :) This is asuming the center of your circle is also the origin of your 'cross with numbers on it'

Sorry, but I'm not english so I don't know what you call the Cartesian cross over there, lol

Scikar
10-07-04, 13:05
Not sure exactly what you mean by your notation, but if (Cx,Cy) are the co-ords of the centre of the circle, and (X,Y) are the co-ords of your point, and you know the radius, then you can use any of the trig formulas.


Assuming you want the angle between the horizontal and your line, then

sin^-1 { (Y-Cy) / (X-Cx) }

will return the angle you're looking for, I think.

P4mp3rk3
10-07-04, 13:10
sin^-1 { (Y-Cy) / (X-Cx) }

that's how you do it when the center of your circle isn't in the origin of the 'cross with all the numbers on it'. But since you can choose where you put the cross, draw it in the center of your circle to make it easier (the angle will stay the same)

Scikar
10-07-04, 13:22
that's how you do it when the center of your circle isn't in the origin of the 'cross with all the numbers on it'. But since you can choose where you put the cross, draw it in the center of your circle to make it easier (the angle will stay the same)
Yeah. I wasn't sure if he could do that though for whatever reason so I gave a more general forumula.

Archeus
10-07-04, 13:37
Cheers!

spongeb0b
10-07-04, 13:40
Whenever you find something that you don't know the answer of,
be aware of the fact that 42 might be the solution


:lol: :lol: :lol: :lol: :lol: :lol: :lol: