@technobuddha/library
Version:
A large library of useful functions
19 lines (18 loc) • 679 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeAngle = void 0;
var modulo_1 = __importDefault(require("../modulo"));
/**
* Normalizes an angle to be in range [0-PI*2]. Angles outside this range will
* be normalized to be the equivalent angle with that range.
* @param angle Angle in radians.
* @return Standardized angle.
*/
function normalizeAngle(radians) {
return modulo_1.default(radians, Math.PI * 2);
}
exports.normalizeAngle = normalizeAngle;
exports.default = normalizeAngle;