check if two angles are in opposite direction
$ npm install --save is-opposed-angle
Returns true
if first and second argument are opposed angles. By default the angles must be passed in radian.
const isOpposedAngle = require('is-opposed-angle');
isOpposedAngle(0, Math.PI);
//=> true
// Use the options argument for degrees
isOpposedAngle(0, 540, {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 angle difference is not exactly opposite but within tolerance
it is still considered opposed. Should be supplied in same unit as angle.
MIT © anoff