import '../../../assert/js/assert.js';
import '../../../globals.js';
/**
 * Quadratic Bezier segment
 *
 * Good reference: http://cagd.cs.byu.edu/~557/text/ch2.pdf
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import Bounds2 from '../../../dot/js/Bounds2.js';
import Matrix3 from '../../../dot/js/Matrix3.js';
import Ray2 from '../../../dot/js/Ray2.js';
import Vector2 from '../../../dot/js/Vector2.js';
import { Cubic, Overlap, RayIntersection, Segment } from '../imports.js';
export type SerializedQuadratic = {
    type: 'Quadratic';
    startX: number;
    startY: number;
    controlX: number;
    controlY: number;
    endX: number;
    endY: number;
};
export default class Quadratic extends Segment {
    private _start;
    private _control;
    private _end;
    private _startTangent;
    private _endTangent;
    private _tCriticalX;
    private _tCriticalY;
    private _bounds;
    private _svgPathFragment;
    /**
     * @param start - Start point of the quadratic bezier
     * @param control - Control point (curve usually doesn't go through here)
     * @param end - End point of the quadratic bezier
     */
    constructor(start: Vector2, control: Vector2, end: Vector2);
    /**
     * Sets the start point of the Quadratic.
     */
    setStart(start: Vector2): this;
    set start(value: Vector2);
    get start(): Vector2;
    /**
     * Returns the start of this Quadratic.
     */
    getStart(): Vector2;
    /**
     * Sets the control point of the Quadratic.
     */
    setControl(control: Vector2): this;
    set control(value: Vector2);
    get control(): Vector2;
    /**
     * Returns the control point of this Quadratic.
     */
    getControl(): Vector2;
    /**
     * Sets the end point of the Quadratic.
     */
    setEnd(end: Vector2): this;
    set end(value: Vector2);
    get end(): Vector2;
    /**
     * Returns the end of this Quadratic.
     */
    getEnd(): Vector2;
    /**
     * Returns the position parametrically, with 0 <= t <= 1.
     *
     * NOTE: positionAt( 0 ) will return the start of the segment, and positionAt( 1 ) will return the end of the
     * segment.
     *
     * This method is part of the Segment API. See Segment.js's constructor for more API documentation.
     */
    positionAt(t: number): Vector2;
    /**
     * Returns the non-normalized tangent (dx/dt, dy/dt) of this segment at the parametric value of t, with 0 <= t <= 1.
     *
     * NOTE: tangentAt( 0 ) will return the tangent at the start of the segment, and tangentAt( 1 ) will return the
     * tangent at the end of the segment.
     *
     * This method is part of the Segment API. See Segment.js's constructor for more API documentation.
     */
    tangentAt(t: number): Vector2;
    /**
     * Returns the signed curvature of the segment at the parametric value t, where 0 <= t <= 1.
     *
     * The curvature will be positive for visual clockwise / mathematical counterclockwise curves, negative for opposite
     * curvature, and 0 for no curvature.
     *
     * NOTE: curvatureAt( 0 ) will return the curvature at the start of the segment, and curvatureAt( 1 ) will return
     * the curvature at the end of the segment.
     *
     * This method is part of the Segment API. See Segment.js's constructor for more API documentation.
     */
    curvatureAt(t: number): number;
    /**
     * Returns an array with up to 2 sub-segments, split at the parametric t value. Together (in order) they should make
     * up the same shape as the current segment.
     *
     * This method is part of the Segment API. See Segment.js's constructor for more API documentation.
     */
    subdivided(t: number): Quadratic[];
    /**
     * Clears cached information, should be called when any of the 'constructor arguments' are mutated.
     */
    invalidate(): void;
    /**
     * Returns the tangent vector (normalized) to the segment at the start, pointing in the direction of motion (from start to end)
     */
    getStartTangent(): Vector2;
    get startTangent(): Vector2;
    /**
     * Returns the tangent vector (normalized) to the segment at the end, pointing in the direction of motion (from start to end)
     */
    getEndTangent(): Vector2;
    get endTangent(): Vector2;
    getTCriticalX(): number;
    get tCriticalX(): number;
    getTCriticalY(): number;
    get tCriticalY(): number;
    /**
     * Returns a list of non-degenerate segments that are equivalent to this segment. Generally gets rid (or simplifies)
     * invalid or repeated segments.
     */
    getNondegenerateSegments(): Segment[];
    /**
     * Returns the bounds of this segment.
     */
    getBounds(): Bounds2;
    get bounds(): Bounds2;
    /**
     * Returns an array of quadratic that are offset to this quadratic by a distance r
     *
     * @param r - distance
     * @param reverse
     */
    offsetTo(r: number, reverse: boolean): Quadratic[];
    /**
     * Elevation of this quadratic Bezier curve to a cubic Bezier curve
     */
    degreeElevated(): Cubic;
    /**
     * @param r - distance
     */
    approximateOffset(r: number): Quadratic;
    /**
     * Returns a string containing the SVG path. assumes that the start point is already provided, so anything that calls this needs to put the M calls first
     */
    getSVGPathFragment(): string;
    /**
     * Returns an array of lines that will draw an offset curve on the logical left side
     */
    strokeLeft(lineWidth: number): Quadratic[];
    /**
     * Returns an array of lines that will draw an offset curve on the logical right side
     */
    strokeRight(lineWidth: number): Quadratic[];
    getInteriorExtremaTs(): number[];
    /**
     * Hit-tests this segment with the ray. An array of all intersections of the ray with this segment will be returned.
     * For details, see the documentation in Segment.js
     */
    intersection(ray: Ray2): RayIntersection[];
    /**
     * Returns the winding number for intersection with a ray
     */
    windingIntersection(ray: Ray2): number;
    /**
     * Draws the segment to the 2D Canvas context, assuming the context's current location is already at the start point
     */
    writeToContext(context: CanvasRenderingContext2D): void;
    /**
     * Returns a new quadratic that represents this quadratic after transformation by the matrix
     */
    transformed(matrix: Matrix3): Quadratic;
    /**
     * Returns the contribution to the signed area computed using Green's Theorem, with P=-y/2 and Q=x/2.
     *
     * NOTE: This is this segment's contribution to the line integral (-y/2 dx + x/2 dy).
     */
    getSignedAreaFragment(): number;
    /**
     * Given the current curve parameterized by t, will return a curve parameterized by x where t = a * x + b
     */
    reparameterized(a: number, b: number): Quadratic;
    /**
     * Returns a reversed copy of this segment (mapping the parametrization from [0,1] => [1,0]).
     */
    reversed(): Quadratic;
    /**
     * Returns an object form that can be turned back into a segment with the corresponding deserialize method.
     */
    serialize(): SerializedQuadratic;
    /**
     * Determine whether two lines overlap over a continuous section, and if so finds the a,b pair such that
     * p( t ) === q( a * t + b ).
     *
     * @param segment
     * @param [epsilon] - Will return overlaps only if no two corresponding points differ by this amount or more in one component.
     * @returns - The solution, if there is one (and only one)
     */
    getOverlaps(segment: Segment, epsilon?: number): Overlap[] | null;
    /**
     * Returns a Quadratic from the serialized representation.
     */
    static deserialize(obj: SerializedQuadratic): Quadratic;
    /**
     * One-dimensional solution to extrema
     */
    static extremaT(start: number, control: number, end: number): number;
    /**
     * Determine whether two Quadratics overlap over a continuous section, and if so finds the a,b pair such that
     * p( t ) === q( a * t + b ).
     *
     * NOTE: for this particular function, we assume we're not degenerate. Things may work if we can be degree-reduced
     * to a quadratic, but generally that shouldn't be done.
     *
     * @param quadratic1
     * @param quadratic2
     * @param [epsilon] - Will return overlaps only if no two corresponding points differ by this amount or more
     *                             in one component.
     * @returns - The solution, if there is one (and only one)
     */
    static getOverlaps(quadratic1: Quadratic, quadratic2: Quadratic, epsilon?: number): Overlap[];
    degree: number;
}
//# sourceMappingURL=Quadratic.d.ts.map