Clip and angle between 0 and 2π ('0to360') or -π to π ('-180to180'). null will return the angle between -2π to 2π.
'0to360'
'-180to180'
null
const clipAngle = Fig.clipAngleconst a1 = clipAngle(Math.PI / 2 * 5, '0to360');console.log(a1);// 1.5707963267948966const a2 = clipAngle(Math.PI / 4 * 5, '-180to180');console.log(a2);// -2.356194490192345const a3 = clipAngle(-Math.PI / 4 * 10, null);console.log(a3);// -1.5707963267948966 Copy
const clipAngle = Fig.clipAngleconst a1 = clipAngle(Math.PI / 2 * 5, '0to360');console.log(a1);// 1.5707963267948966const a2 = clipAngle(Math.PI / 4 * 5, '-180to180');console.log(a2);// -2.356194490192345const a3 = clipAngle(-Math.PI / 4 * 10, null);console.log(a3);// -1.5707963267948966
Clip and angle between 0 and 2π (
'0to360') or -π to π ('-180to180').nullwill return the angle between -2π to 2π.