calculate compass angle from coordinates

cutterpg

New Member
Joined
Sep 7, 2002
Messages
1
I'm trying to find the simplest way to convert a trig angle measurement (between 180 and -180 degrees (or pi and -pi radians)) originating from the positive side of the x axis) to a standard compass bearing (between 0 and 360 degrees originating clockwise from the positive y axis).

I can't come up with a formula or algorithm that works with any angle value.

Thanks in advance for your help.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
For limited angle degree inputs of -90 to +360, the following works:

bearing = if(angle<=90,90-Angle,450-Angle)

If you need it for ANY angle input, positive or negative without bound, you'll have to get fancier by using the Modulus function to get rid of multiples of 360, and work with the degrees left over.

HTH
 
Upvote 0
A great source for this sort of thing is mathtools.net. Quick search there (for 'degrees') sent me to :

http://www.em-ing.de/home_e.htm

where there is a free add in for 'advanced trigonometric functions' add in (on the freeware link). Might help out...

Paddy
 
Upvote 0
Do it this way:
if X is positive and Y is positive (XY=++), use 90 - theta
if XY = -+, use 270 - theta
if XY = +-, use 90 - theta
if XY = --, use 270 - theta

Where theta = atan(Y/X) (in degrees) in the cartesian plane.
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top