Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relative position of 2 points on a circle 2

Status
Not open for further replies.

ziggyS

Computer
Joined
Mar 14, 2015
Messages
3
Location
AU
hi
this question was addressed in thread770-356581 but the resulting formula is only valid for points within 90 degrees of each other

stevenal (Electrical) 21 Jan 14 20:12
'=DEGREES(ASIN(SIN(RADIANS(A1-A2))))'
Excel

recap if point A1 is at position 358 degrees
point A2 is at position 01 degrees
above formula returns -3 (position of A1 relative to A2)

but if point A1 is at position 180 degrees
point A2 is at position 01 degree
above formula returns +1 (required return is +179)

can anyone expand on above formula to be valid over complete circle (+- 180)

thanks
ziggyS
 
i have changed formula to
'=DEGREES(ACOS(COS(RADIANS(A1-A2))))'
which returns the correct whole number but i lose the polarity
 
This should work (it works for your examples):

=DEGREES(ATAN2(COS(RADIANS(A1-A2)),SIN(RADIANS(A1-A2))))

There may be a simpler way, but I doubt it can be done with just sin or just cos.

Doug Jenkins
Interactive Design Services
 
thanks IDS absolutely perfect!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top