@baku89/pave - v0.4.1 / Arc
Namespace: Arc
A collection of functions to handle arcs represented with SegmentA.
Utilities
toCenterParameterization
▸ toCenterParameterization(arg
): Object
Converts the Arc command to a center parameterization that can be used in Context2D.ellipse(). https://observablehq.com/@awhitty/svg-2-elliptical-arc-to-canvas-path2d
Parameters
Name | Type |
---|---|
arg | SimpleSegmentA |
Returns
Object
Name | Type |
---|---|
angles | AngleRange |
center | vec2 |
radii | vec2 |
sweep | boolean |
xAxisRotation | number |
Defined in
Other
approximateByCubicBeziers
▸ approximateByCubicBeziers(arc
, angle
): VertexC
[]
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
angle | number |
Returns
VertexC
[]
Defined in
bounds
▸ bounds(arg
): Rect
Calculates the bound of given arc.
Parameters
Name | Type |
---|---|
arg | SimpleSegmentA |
Returns
The bound of the arc
Example
Defined in
derivative
▸ derivative(arc
, loc
): vec2
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
loc | SegmentLocation |
Returns
vec2
Defined in
divideAtTimes
▸ divideAtTimes(arc
, times
): VertexA
[]
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
times | Iterable <number > |
Returns
VertexA
[]
Defined in
ellipticArcLength
▸ ellipticArcLength(radii
, angles
): number
Parameters
Name | Type |
---|---|
radii | vec2 |
angles | AngleRange |
Returns
number
Defined in
isStraight
▸ isStraight(arc
): boolean
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
Returns
boolean
Defined in
isZero
▸ isZero(arg
): boolean
Returns true if the length of arc segment is zero.
Parameters
Name | Type |
---|---|
arg | SimpleSegmentA |
Returns
boolean
Defined in
length
▸ length(arg
): number
Parameters
Name | Type |
---|---|
arg | SimpleSegmentA |
Returns
number
Defined in
normal
▸ normal(arc
, loc
): vec2
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
loc | SegmentLocation |
Returns
vec2
Defined in
offset
▸ offset(arc
, distance
, unarcAngle?
): Path
Parameters
Name | Type | Default value |
---|---|---|
arc | SimpleSegmentA | undefined |
distance | number | undefined |
unarcAngle | number | 90 |
Returns
Defined in
point
▸ point(arc
, loc
): vec2
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
loc | SegmentLocation |
Returns
vec2
Defined in
tangent
▸ tangent(arc
, loc
): vec2
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
loc | SegmentLocation |
Returns
vec2
Defined in
toTime
▸ toTime(arc
, loc
): number
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
loc | SegmentLocation |
Returns
number
Defined in
transform
▸ transform(arc
, matrix
): SegmentA
Transforms the given arc segment with the given matrix.
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
matrix | mat2d |
Returns
See
https://gist.github.com/timo22345/9413158#file-flatten-js-L443-L547
Defined in
trim
▸ trim(arc
, start
, end
): SegmentA
Parameters
Name | Type |
---|---|
arc | SimpleSegmentA |
start | SegmentLocation |
end | SegmentLocation |