import { Point } from '../point.js'; /** * Adds two points together. * @param {Point} a - The first point to add. * @param {Point} b - The second point to add. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point containing the sum of the two points. */ export declare const add: (a: Point, b: Point, output?: Point | null) => Point; /** * Subtracts the second point from the first point. * @param {Point} a - The first point to subtract from. * @param {Point} b - The second point to subtract. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point containing the difference of the two points. */ export declare const subtract: (a: Point, b: Point, output?: Point | null) => Point; /** * Multiplies two points together. * @param {Point} a - The first point to multiply. * @param {Point} b - The second point to multiply. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point containing the product of the two points. */ export declare const multiply: (a: Point, b: Point, output?: Point | null) => Point; /** * Divides the first point by the second point. * @param {Point} a - The first point to divide. * @param {Point} b - The second point to divide by. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point containing the quotient of the two points. */ export declare const divide: (a: Point, b: Point, output?: Point | null) => Point; /** * Checks if two points are equal. * @param {Point} a - The first point to compare. * @param {Point} b - The second point to compare. * @returns {boolean} True if the points are equal, false otherwise. */ export declare const equals: (a: Point, b: Point) => boolean; /** * Calculates the angle between two points. * @param {Point} a - The first point to calculate the angle from. * @param {Point} b - The second point to calculate the angle to. * @returns {number} The angle between the two points in radians. */ export declare const angle: (a: Point, b: Point) => number; /** * Creates a new point with the same coordinates as the input point but with inverted signs. * @param {Point} a - The point to negate. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point with negated coordinates. */ export declare const negative: (a: Point, output?: Point | null) => Point; /** * Multiplies the second point by a scalar and adds it to the first point. * @param {Point} a - The first point to add to. * @param {Point} b - The second point to multiply by the scalar and add. * @param {number} s - The scalar value to multiply the second point by. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point with the result of the operation. */ export declare const multiplyAdd: (a: Point, b: Point, s: number, output?: Point | null) => Point; /** * Interpolates between two points at a given factor. * @param {Point} a - The first point to interpolate from. * @param {Point} b - The second point to interpolate to. * @param {number} f - The interpolation factor (0-1). * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point interpolated between the two points. */ export declare const interpolate: (a: Point, b: Point, f: number, output?: Point | null) => Point; /** * Returns a perpendicular point (rotated 90 degrees counter-clockwise). * @param {Point} a - The point to calculate the perpendicular for. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point that is perpendicular to the input point. */ export declare const perp: (a: Point, output?: Point | null) => Point; /** * Returns a perpendicular point (rotated 90 degrees clockwise). * @param {Point} a - The point to calculate the perpendicular for. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point that is perpendicular to the input point (rotated clockwise). */ export declare const rperp: (a: Point, output?: Point | null) => Point; /** * Calculates the distance between two points. * @param {Point} a - The first point to calculate the distance from. * @param {Point} b - The second point to calculate the distance to. * @param {boolean} round - Whether to round the result (default: false). * @returns {number} The distance between the two points. */ export declare const distance: (a: Point, b: Point, round?: boolean) => number; /** * Projects the first point onto the second point. * @param {Point} a - The point to project. * @param {Point} b - The point to project onto. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point with the projected result. */ export declare const project: (a: Point, b: Point, output?: Point | null) => Point; /** * Projects the first point onto the unit vector of the second point. * @param {Point} a - The point to project. * @param {Point} b - The point to project onto (unit vector). * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point with the projected result. */ export declare const projectUnit: (a: Point, b: Point, output?: Point | null) => Point; /** * Returns a point with the same direction as the input point but with y coordinate negated. * @param {Point} a - The point to calculate the normal for. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point with the same x coordinate but negated y coordinate. */ export declare const normalRightHand: (a: Point, output?: Point | null) => Point; /** * Normalizes the input point to have a magnitude of 1 while preserving its direction. * @param {Point} a - The point to normalize. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new normalized point. */ export declare const normalize: (a: Point, output?: Point | null) => Point; /** * Rotates a point around another point by a given angle. * @param {Point} a - The point to rotate. * @param {number} x - The x coordinate of the center point to rotate around. * @param {number} y - The y coordinate of the center point to rotate around. * @param {number} ang - The angle in radians to rotate by. * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false). * @param {number | null | undefined} dist - The distance to rotate from (default: null). * @returns {Point} The rotated point instance for chaining. */ export declare const rotate: (a: Point, x: number, y: number, ang: number, asDegrees: boolean, dist: number | null | undefined) => Point; /** * Calculates the centroid (average position) of a set of points. * @param {Point[]} points - The array of points to calculate the centroid for. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point representing the centroid of the input points. * @throws {Error} If the points array is empty. */ export declare const centroid: (points: Point[], output?: Point | null) => Point; /** * Parses an object with x and y properties into a Point. * @param {object} obj - The object to parse (must have x and y properties). * @param {string} xProp - The name of the property containing the x value (default: 'x'). * @param {string} yProp - The name of the property containing the y value (default: 'y'). * @returns {Point} A new point with parsed x and y values. */ export declare const parse: (obj: Record, xProp?: string, yProp?: string) => Point; /** * Creates a clone of the input point. * @param {Point} input - The point to clone. * @param {Point} output - The point to store the result in (optional). * @returns {Point} A new point with the same coordinates as the input. */ export declare const clone: (input: Point, output?: Point | null) => Point; //# sourceMappingURL=point.d.ts.map