@thi.ng/geom
Version:
Functional, polymorphic API for 2D geometry types & SVG generation
59 lines • 2.01 kB
TypeScript
import type { Attribs } from "./api.js";
import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
import { Arc } from "./api/arc.js";
/**
* Creates a new elliptic {@link Arc} from given `center`, `radii`, `axis`
* rotation, `start` and `end` angles (in radians).
*
* @remarks
* The `xl` (large arc) and `clockwise` params are defaulting to:
*
* - xl = true if |start-end| > PI
* - clockwise = true if end > start
*
* References:
*
* - https://svgwg.org/svg2-draft/paths.html#PathDataEllipticalArcCommands
* - https://svgwg.org/svg2-draft/images/paths/arcs02.svg
*
* Also see {@link arcFrom2Points}, {@link pathFromSvg} for an alternative
* construction.
*
* @param center
* @param radii
* @param axis
* @param start
* @param end
* @param xl
* @param clockwise
* @param attribs
*/
export declare const arc: (center: Vec, radii: number | Vec, axis: number, start: number, end: number, xl?: boolean, clockwise?: boolean, attribs?: Attribs) => Arc;
/**
* Constructs a new {@link Arc} between the two given points `a` and `b` using
* `radii`, `axis` rotation (in radians) and `xl`, `clockwise` params to
* configure which of 4 possible arcs will be chosen.
*
* @remarks
* This function returns `undefined` if it's mathematically impossible to create
* an arc with the given parameters.
*
* References:
*
* - https://svgwg.org/svg2-draft/paths.html#PathDataEllipticalArcCommands
* - https://svgwg.org/svg2-draft/images/paths/arcs02.svg
* - https://svgwg.org/svg2-draft/implnote.html#ArcConversionEndpointToCenter
* - https://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
*
* Also see {@link arc}, {@link pathFromSvg} for an alternative construction.
*
* @param a
* @param b
* @param radii
* @param axis
* @param xl
* @param cw
* @param attribs
*/
export declare const arcFrom2Points: (a: ReadonlyVec, b: ReadonlyVec, radii: ReadonlyVec, axis?: number, xl?: boolean, cw?: boolean, attribs?: Attribs) => Arc | undefined;
//# sourceMappingURL=arc.d.ts.map