import { vec } from "mafs"; import type { PerseusStrings } from "../../../strings"; import type { PairOfPoints } from "../types"; import type { Coord } from "@khanacademy/perseus-core"; import type { Interval } from "mafs"; /** * Given a ray and a rectangular box, find the point where the ray intersects * the edge of the box. Assumes the `initialPoint` is inside the box. * @param initialPoint - The starting point of the ray. * @param throughPoint - A point that the ray passes through. Must be different from initialPoint. * @param box - The box with which to intersect the ray, in the form [[xMin, xMax], [yMin, yMax]] */ export declare const getIntersectionOfRayWithBox: (initialPoint: vec.Vector2, throughPoint: vec.Vector2, box: [x: Interval, y: Interval]) => [number, number]; export declare function getArrayWithoutDuplicates(array: Array): Array; export declare function getSlopeStringForLine(line: PairOfPoints, strings: PerseusStrings): string; export declare function getInterceptStringForLine(line: PairOfPoints, strings: PerseusStrings, locale: string): string; export declare function getQuadraticVertexString(vertex: Coord, strings: PerseusStrings): string; export declare function getQuadraticPointString(pointNumber: any, coord: Coord, strings: PerseusStrings, locale: string): string; export declare function getQuadraticXIntercepts(a: number, b: number, c: number): number[]; /** * Given a list of points, return the angle made by the point at index i * with the points at indices i - 1 and i + 1. */ export declare function getAngleFromPoints(points: Coord[], i: number): number | null; export declare function getSideLengthsFromPoints(points: Coord[], i: number, isPolygonOpen?: boolean): Array<{ pointIndex: number; sideLength: number; }>; /** * Determine whether to determine the string with the * exact side length or the approximate side length. */ export declare function getPolygonSideString(sideLength: number, pointIndex: number, strings: PerseusStrings, locale: string): string; /** * Calculate an appropriate radius for angle arcs based on the graph range. * The radius scales with the range so it's visible at all graph sizes. */ export declare function calculateScaledRadius(range: [Interval, Interval]): number; /** * Shared keyboard constraint logic for asymptote-based graph points * (exponential, logarithm). Computes the next valid position for each * arrow-key direction, skipping up to 3 snap steps to avoid positions * rejected by the caller's `isValidPosition` predicate. * * The per-graph validity rules differ (exponential checks Y vs asymptote and * X vs other point; logarithm checks X vs asymptote and Y vs other point), * so they are injected via the callback. */ export declare function getAsymptoteGraphKeyboardConstraint(coords: ReadonlyArray, snapStep: vec.Vector2, pointIndex: number, isValidPosition: (coord: vec.Vector2) => boolean): { up: vec.Vector2; down: vec.Vector2; left: vec.Vector2; right: vec.Vector2; }; /** * Shared keyboard constraint for asymptote movement (exponential, logarithm). * When the next snapped position would land between or on the curve points, * snaps past all of them in the direction of travel using a midpoint heuristic. * * @param orientation - "horizontal" for exponential (asymptote moves on Y-axis), * "vertical" for logarithm (asymptote moves on X-axis). */ export declare function constrainAsymptoteKeyboardMovement(p: vec.Vector2, coords: ReadonlyArray, snapStep: vec.Vector2, orientation: "horizontal" | "vertical"): vec.Vector2;