@mocanvas/editor · class

Arc2d

declare class Arc2d extends Geometry2d

A circular arc, given the way SVG gives one: a centre, two endpoints, and the two flags that pick which of the four possible arcs between them is meant.


Methods · 8

constructor(config: Flags & {
getLength(): number
getPointAt(t: number): Vec

The point at t along the arc, t in [0, 1].

getVertices(): Vec[]
interpolateAlongEdge(t: number): Vec
nearestPoint(point: VecLike): Vec
toPathWords(): number[]
uninterpolateAlongEdge(point: VecLike): number

Properties · 9

readonly _center: Vec

The centre of the circle the arc is cut from. Named apart from the inherited center, which is the centre of the arc's bounding box and is a different point entirely.

readonly angleEnd: number

The angle from the centre to end.

readonly angleStart: number

The angle from the centre to start.

readonly end: Vec
readonly largeArcFlag: number
readonly measure: number

The signed sweep of the arc, in radians. Negative runs anti-clockwise.

readonly radius: number
readonly start: Vec
readonly sweepFlag: number

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.