/** * Modulate a value between two ranges. * @param value * @param rangeA from [low, high] * @param rangeB to [low, high] * @param clamp */ export declare function modulate(value: number, rangeA: number[], rangeB: number[], clamp?: boolean): number; /** * Rotate a point around a center. * @param x The x-axis coordinate of the point. * @param y The y-axis coordinate of the point. * @param cx The x-axis coordinate of the point to rotate round. * @param cy The y-axis coordinate of the point to rotate round. * @param angle The distance (in radians) to rotate. */ export declare function rotatePoint(x: number, y: number, cx: number, cy: number, angle: number): number[]; /** * Get the distance between two points. * @param x0 The x-axis coordinate of the first point. * @param y0 The y-axis coordinate of the first point. * @param x1 The x-axis coordinate of the second point. * @param y1 The y-axis coordinate of the second point. */ export declare function getDistance(x0: number, y0: number, x1: number, y1: number): number; /** * Get an angle (radians) between two points. * @param x0 The x-axis coordinate of the first point. * @param y0 The y-axis coordinate of the first point. * @param x1 The x-axis coordinate of the second point. * @param y1 The y-axis coordinate of the second point. */ export declare function getAngle(x0: number, y0: number, x1: number, y1: number): number; /** * Move a point in an angle by a distance. * @param x0 * @param y0 * @param a angle (radians) * @param d distance */ export declare function projectPoint(x0: number, y0: number, a: number, d: number): number[]; /** * Get a point between two points. * @param x0 The x-axis coordinate of the first point. * @param y0 The y-axis coordinate of the first point. * @param x1 The x-axis coordinate of the second point. * @param y1 The y-axis coordinate of the second point. * @param d Normalized */ export declare function getPointBetween(x0: number, y0: number, x1: number, y1: number, d?: number): number[]; /** * Get the sector of an angle (e.g. quadrant, octant) * @param a The angle to check. * @param s The number of sectors to check. */ export declare function getSector(a: number, s?: number): number; /** * Get a normal value representing how close two points are from being at a 45 degree angle. * @param x0 The x-axis coordinate of the first point. * @param y0 The y-axis coordinate of the first point. * @param x1 The x-axis coordinate of the second point. * @param y1 The y-axis coordinate of the second point. */ export declare function getAngliness(x0: number, y0: number, x1: number, y1: number): number; /** * Get the points at which an ellipse intersects a rectangle. * @param x * @param y * @param w * @param h * @param cx * @param cy * @param rx * @param ry * @param angle */ export declare function getEllipseRectangleIntersectionPoints(x: number, y: number, w: number, h: number, cx: number, cy: number, rx: number, ry: number, angle: number): number[][]; /** * Find the point(s) where a line segment intersects an ellipse. * @param x0 The x-axis coordinate of the line's start point. * @param y0 The y-axis coordinate of the line's start point. * @param x1 The x-axis coordinate of the line's end point. * @param y1 The y-axis coordinate of the line's end point. * @param cx The x-axis (horizontal) coordinate of the ellipse's center. * @param cy The y-axis (vertical) coordinate of the ellipse's center. * @param rx The ellipse's major-axis radius. Must be non-negative. * @param ry The ellipse's minor-axis radius. Must be non-negative. * @param rotation The rotation of the ellipse, expressed in radians. * @param segment_only When true, will test the segment as a line (of infinite length). */ export declare function getEllipseSegmentIntersections(x0: number, y0: number, x1: number, y1: number, cx: number, cy: number, rx: number, ry: number, rotation?: number, segment_only?: boolean): number[][]; /** * Check whether two rectangles will collide (overlap). * @param x0 The x-axis coordinate of the first rectangle. * @param y0 The y-axis coordinate of the first rectangle. * @param w0 The width of the first rectangle. * @param h0 The height of the first rectangle. * @param x1 The x-axis coordinate of the second rectangle. * @param y1 The y-axis coordinate of the second rectangle. * @param w1 The width of the second rectangle. * @param h1 The height of the second rectangle. */ export declare function doRectanglesCollide(x0: number, y0: number, w0: number, h0: number, x1: number, y1: number, w1: number, h1: number): boolean; /** * Find the point(s) where a segment intersects a rectangle. * @param x0 The x-axis coordinate of the segment's starting point. * @param y0 The y-axis coordinate of the segment's starting point. * @param x1 The x-axis coordinate of the segment's ending point. * @param y1 The y-axis coordinate of the segment's ending point. * @param x The x-axis coordinate of the rectangle. * @param y The y-axis coordinate of the rectangle. * @param w The width of the rectangle. * @param h The height of the rectangle. */ export declare function getSegmentRectangleIntersectionPoints(x0: number, y0: number, x1: number, y1: number, x: number, y: number, w: number, h: number): number[][]; /** * Find the point, if any, where two segments intersect. * @param x0 The x-axis coordinate of the first segment's starting point. * @param y0 The y-axis coordinate of the first segment's starting point. * @param x1 The x-axis coordinate of the first segment's ending point. * @param y1 The y-axis coordinate of the first segment's ending point. * @param x2 The x-axis coordinate of the second segment's starting point. * @param y2 The y-axis coordinate of the second segment's starting point. * @param x3 The x-axis coordinate of the second segment's ending point. * @param y3 The y-axis coordinate of the second segment's ending point. */ export declare function getSegmentSegmentIntersection(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): number[] | undefined; /** * Get the intersection points between a line segment and a rectangle with rounded corners. * @param x0 The x-axis coordinate of the segment's starting point. * @param y0 The y-axis coordinate of the segment's ending point. * @param x1 The delta-x of the ray. * @param y1 The delta-y of the ray. * @param x The x-axis coordinate of the rectangle. * @param y The y-axis coordinate of the rectangle. * @param w The width of the rectangle. * @param h The height of the rectangle. * @param r The corner radius of the rectangle. */ export declare function getSegmentRoundedRectangleIntersectionPoints(x0: number, y0: number, x1: number, y1: number, x: number, y: number, w: number, h: number, r: number): number[][]; /** * Get the point(s) where a line segment intersects a circle. * @param cx The x-axis coordinate of the circle's center. * @param cy The y-axis coordinate of the circle's center. * @param r The circle's radius. * @param x0 The x-axis coordinate of the segment's starting point. * @param y0 The y-axis coordinate of ththe segment's ending point. * @param x1 The delta-x of the ray. * @param y1 The delta-y of the ray. */ export declare function getSegmentCircleIntersections(cx: number, cy: number, r: number, x0: number, y0: number, x1: number, y1: number): number[][]; /** * Normalize an angle (in radians) * @param radians The radians quantity to normalize. */ export declare function normalizeAngle(radians: number): number; /** * * @param x The x-axis coordinate of the ray's origin. * @param y The y-axis coordinate of the ray's origin. * @param w * @param h * @param x0 * @param y0 * @param x1 * @param y1 */ export declare function getRayRectangleIntersectionPoints(ox: number, oy: number, dx: number, dy: number, x: number, y: number, w: number, h: number): number[][]; /** * Get the point at which a ray intersects a segment. * @param x The x-axis coordinate of the ray's origin. * @param y The y-axis coordinate of the ray's origin. * @param dx The x-axis delta of the angle. * @param dy The y-axis delta of the angle. * @param x0 The x-axis coordinate of the segment's start point. * @param y0 The y-axis coordinate of the segment's start point. * @param x1 The x-axis coordinate of the segment's end point. * @param y1 The y-axis coordinate of the segment's end point. */ export declare function getRaySegmentIntersection(x: number, y: number, dx: number, dy: number, x0: number, y0: number, x1: number, y1: number): number[] | undefined; /** * Get the normalized delta (x and y) for an angle. * @param angle The angle in radians */ export declare function getDelta(angle: number): number[]; export declare function getIntermediate(angle: number): number; /** * Get a line between two rounded rectangles. * @param x0 * @param y0 * @param w0 * @param h0 * @param r0 * @param x1 * @param y1 * @param w1 * @param h1 * @param r1 */ export declare function getLineBetweenRoundedRectangles(x0: number, y0: number, w0: number, h0: number, r0: number, x1: number, y1: number, w1: number, h1: number, r1: number): number[]; /** * Get the intersection points between a ray and a rectangle with rounded corners. * @param ox The x-axis coordinate of the ray's origin. * @param oy The y-axis coordinate of the ray's origin. * @param dx The delta-x of the ray. * @param dy The delta-y of the ray. * @param x The x-axis coordinate of the rectangle. * @param y The y-axis coordinate of the rectangle. * @param w The width of the rectangle. * @param h The height of the rectangle. * @param r The corner radius of the rectangle. */ export declare function getRayRoundedRectangleIntersection(ox: number, oy: number, dx: number, dy: number, x: number, y: number, w: number, h: number, r: number): number[][]; export declare function getRectangleSegmentIntersectedByRay(x: number, y: number, w: number, h: number, ox: number, oy: number, dx: number, dy: number): number[] | undefined; export declare function getRectangleSegments(x: number, y: number, w: number, h: number): number[][]; export declare function getRoundedRectangleSegments(x: number, y: number, w: number, h: number, r: number): number[][]; export declare function getRayCircleIntersection(cx: number, cy: number, r: number, ox: number, oy: number, dx: number, dy: number): number[][];