Jump to content

Our forum made possible by displaying online advertisements to our visitors.

Please consider supporting us by disabling your ads blocker.

  • Announcements

    • EmperoR

      Dear Guests   12/24/2016

      Welcome to the GIS-AREA. like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be a part of GIS-AREA by signing in or creating an account here. Once you have created your account and have introduced yourself to our community, you can start new topics, reply to others, subscribe interesting threads, get your customize profiles, make news friends, and others nice stuff. To make your stay as pleasant and constructive as possible, please don't forget to read through our pinned forum rules and board guidelines in each section before you do anything else.
Sign in to follow this  

Calculate direction / angle between polar coordinates

Recommended Posts

sAnSiBaR    32

Hi folks,

I think there would be a simple geodetic solution for my question, but let's see:

I want to get the direction like on a compass between 0° and 360° between two polar coordinates.
How does this work?

for example:
r_1 = 4.47 theta_1 = 63.4
r_2 = 6.32 theta_2 = 71.6

For the result it does not matter if north or south, nor if it's 90° or 270°, only the absolute value is relevant.
Cartesian coordinates unfortunately dont work in case if points are vertically aligned (infinite slope).



Share this post

Link to post
Share on other sites
jorrarro    11

This depends on where do you need to use this calculation. Mostly you can convert them to cartesian and then use application-specific methods to avoid errors.

For example, in Excel you can use IFERROR function to default all divisions by zero (vertically aligned) to 0 or 180 degrees.

In SQL you can use NULLIF on divisors equalling zero and then COALESCE to default value.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

By using this site, you agree to our Terms of Use.