"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.deleteProperty = deleteProperty;
exports.intLimit = intLimit;
exports.radToDeg = radToDeg;
exports.degToRad = degToRad;

/**
 * delete some property
 *
 * @export
 * @param {*} ctx
 * @param {string[]} deletes
 */
function deleteProperty(ctx, deletes) {
  if (deletes && Array.isArray(deletes)) {
    deletes.forEach(function (key) {
      if (ctx[key]) {
        delete ctx[key];
      }
    });
  }
}
/**
 * 角度限制 0～360
 *
 * @export
 * @param {number} int
 * @param {number} circle
 * @returns
 */


function intLimit(int, circle) {
  // 0 <= int <= circle
  return (int % circle + circle) % circle;
}
/**
 * Converses radius to degree
 * @param rad
 * @returns
 */


function radToDeg(rad) {
  return rad * 180 / Math.PI;
}
/**
 * Converses degree to radius
 * @param deg
 * @returns
 */


function degToRad(deg) {
  return deg * Math.PI / 180;
}