formula for a x, y plot

S

shawn bright

hey there all,

ok, not really a ruby question, but did not know where to look.
i have a circle on a graph paper.
if i know the x and y of a point on the graph, if the center is at
0,0, and i know the radius,
how can i find the angle that the point will be on the circumference?
somewhere between 1-360.

would appreciate any tips, thanks
ok, if it is really against the grain to post this question here,
anyone have a recommendation of where to put it?
thanks all

sk
 
J

Joel VanderWerf

shawn said:
hey there all,

ok, not really a ruby question, but did not know where to look.
i have a circle on a graph paper.
if i know the x and y of a point on the graph, if the center is at
0,0, and i know the radius,
how can i find the angle that the point will be on the circumference?
somewhere between 1-360.

would appreciate any tips, thanks
ok, if it is really against the grain to post this question here,
anyone have a recommendation of where to put it?
thanks all

sk

irb(main):007:0> Math.atan2(-1.0, -1.0)*180/Math::pI % 360
=> 225.0
irb(main):008:0> Math.atan2(-1.0, 1.0)*180/Math::pI % 360
=> 315.0
irb(main):009:0> Math.atan2(1.0, 1.0)*180/Math::pI % 360
=> 45.0
irb(main):010:0> Math.atan2(1.0, -1.0)*180/Math::pI % 360
=> 135.0

HTH.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top