I was wondering what the method getAngle returns so that I can determine the direction that a given location is from my current location.

# What does the getAngle method return? and how is it interpreted?

**nmalaguti**#2

`getAngle`

returns the angle between the source and destination in radians.

The Math.atan2() method returns a numeric value between -π and π representing the angle theta of an (x, y) point. This is the counterclockwise angle, measured in radians, between the positive X axis, and the point (x, y). Note that the arguments to this function pass the y-coordinate first and the x-coordinate second.

From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2

```
PI4 = 3.14159 / 4
if (angle >= -PI4 && angle <= PI4) {
// WEST
} else if (angle >= PI4 && angle <= 3 * PI4) {
// SOUTH
} else if (angle >= 3 * PI4 || angle <= 3 * -PI4) {
// EAST
} else { // if (angle >= 3 * -PI4 && angle <= -PI4)
// NORTH
}
```