gs-json
Version:
gs-JSON is a domain agnostic unifying 3D file format for geometric and semantic modelling (hence the 'gs').
27 lines • 637 B
JavaScript
/**
* Corrects the angles in a circle
* @param
* @return
*/
export function checkCircleAngles(angles) {
if (angles === undefined || angles === null) {
return undefined;
}
// fix angle 0
if (Math.abs(angles[0]) > 360) {
angles[0] = angles[0] % 360;
}
if (angles[0] < 0) {
angles[0] = 360 + angles[0];
}
// fix angle 1
if (Math.abs(angles[1]) > 360) {
angles[1] = angles[1] % 360;
}
if (angles[1] < 0) {
angles[1] = 360 + angles[1];
}
// return the fixed angles
return angles;
}
//# sourceMappingURL=_utils.js.map