gpml2pvjson
Version:
convert GPML (XML) to pvjson (json)
125 lines (124 loc) • 3.12 kB
TypeScript
/**
* Convert from radians to degrees
*
* @param {number} radians
* @returns {number} degrees
*/
export declare function radiansToDegrees(radians: number): number;
/**
* Convert from degrees to radians
*
* @param {number} degrees
* @returns {number} radians
*/
export declare function degreesToRadians(degrees: number): number;
/**
* Normalize an arbitrary angle to the interval [-180, 180)
*
* @param {number} n
* @returns {number}
*/
export declare function normalizeHalf(n: any): number;
/**
* Normalize an arbitrary angle to the interval [0, 360)
*
* @param {number} n
* @returns {number}
*/
export declare function normalize(n: any): number;
/**
* Gets the shortest direction to rotate to another angle
*
* @param {number} from
* @param {number} to
* @returns {number}
*/
export declare function shortestDirection(from: any, to: any): 1 | 0 | -1;
/**
* Checks if an angle is between two other angles
*
* @param {number} n
* @param {number} a
* @param {number} b
* @returns {boolean}
*/
export declare function between(n: any, a: any, b: any): boolean;
/**
* Calculates the angular difference between two angles
* @param {number} a
* @param {number} b
* @returns {number}
*/
export declare function diff(a: any, b: any): number;
/**
* Calculate the minimal distance between two angles
*
* @param {number} a
* @param {number} b
* @returns {number}
*/
export declare function distance(a: any, b: any): number;
/**
* Calculate radians from current angle
*
* @param {number} n
* @returns {number}
*/
export declare function toRad(n: any): number;
/**
* Calculate degrees from current angle
*
* @param {number} n
* @returns {number}
*/
export declare function toDeg(n: any): number;
/**
* Calculate gons from current angle
*
* @param {number} n
* @returns {number}
*/
export declare function toGon(n: any): number;
/**
* Given the sine and cosine of an angle, what is the original angle?
*
* @param {number} sin
* @param {number} cos
* @returns {number}
*/
export declare function fromSinCos(sin: any, cos: any): number;
/**
* What is the angle of two points making a line
*
* @param {Array} p1
* @param {Array} p2
* @returns {number}
*/
export declare function fromSlope(p1: any, p2: any): number;
/**
* Returns the quadrant
*
* @param {number} x The point x-coordinate
* @param {number} y The point y-coordinate
* @param {number=} k The optional number of regions in the coordinate-system
* @param {number=} shift An optional angle to rotate the coordinate system
* @returns {number}
*/
export declare function quadrant(x: any, y: any, k: any, shift: any): number;
/**
* Calculates the compass direction of the given angle
*
* @param {number} angle
* @returns {string}
*/
export declare function compass(course: any): string;
/**
* Calculates the linear interpolation of two angles
*
* @param {number} a Angle one
* @param {number} b Angle two
* @param {number} p Percentage
* @param {number} dir Direction (either 1 [=CW] or -1 [=CCW])
* @returns {number}
*/
export declare function lerp(a: any, b: any, p: any, dir: any): any;