is-opposed-angle
check if two angles are in opposite direction
Install
$ npm install --save is-opposed-angle
Usage
Returns true
if first and second argument are opposed angles. By default the angles must be passed in radian.
const isOpposedAngle = ; ;//=> true // Use the options argument for degrees;//=> true
API
Boolean
isOpposedAngle(angle1, angle2, [options]) : angle1 [rad]
Type: number
First angle by default it is assumed to be in radian format. See options for using other angle units.
angle2 [rad]
Type: number
Second angle by default it is assumed to be in radian format. See options for using other angle units.
options
isDegree
Type: boolean
Default: false
Interpret the angle1
and angle2
values in degrees.
tolerance [rad]
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.
License
MIT © anoff