angle-between-points

given two points, it returns the angle in degrees from one to the other


Keywords
angle, trigonometry, degrees, radians, points
License
MIT
Install
npm install angle-between-points@1.0.0

Documentation

angle-between-points

Given two points, it returns the angle in degrees from one to the other.

NPM

build status

EXAMPLE

angleBetweenPoints(point1, point2)

var angleBetweenPoints = require('angle-between-points');

angleBetweenPoints( {x: 1, y: 1}, {x: 4, y: 4} );
// returns 45

angleBetweenPoints( {x: 2, y: 2}, {x: -4, y: -4} );
// returns 225

angleBetweenPoints( {x: 2, y: 0}, {x: -4, y: 0} );
// returns 180

LICENSE

MIT