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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

SteveInAlabama

Board Regular
Joined
Aug 22, 2002
Messages
94
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
 

stevebausch

Well-known Member
Joined
May 11, 2002
Messages
810
Any decent computer-aided astrologer can talk on this stuff until your eyes glaze over.
 

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
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
 

jeff_manning

New Member
Joined
Aug 2, 2011
Messages
1
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.
 

Forum statistics

Threads
1,144,148
Messages
5,722,779
Members
422,457
Latest member
Mrmuskins

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
Top