check if two angles are pointing in the same/similar direction
$ npm install --save is-same-angle
Returns true
if first and second argument are same angles. By default the angles must be passed in radian.
const isSameAngle = require('is-same-angle');
isSameAngle(0, 2 * Math.PI);
//=> true
// Use the options argument for degrees
isSameAngle(0, 360, {isDegree: true});
//=> true
Type: number
First angle by default it is assumed to be in radian format. See options for using other angle units.
Type: number
Second angle by default it is assumed to be in radian format. See options for using other angle units.
Type: boolean
Default: false
Interpret the angle1
and angle2
values in degrees.
Type: number
Default: 0.1
If the angles are not exactly identical but within tolerance
it is still considered same. Should be supplied in same unit as angle.
- is-opposed-angle: same thing different angle
MIT © anoff