@baku89/pave / Line
Line
A collection of functions to handle a line represented with SegmentL.
Variables
curvature
constcurvature:0=0
Defined in: Line.ts:50
Functions
bounds()
bounds(
line):Rect
Defined in: Line.ts:24
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
Returns
Rect
derivative()
derivative(
line):vec2
Defined in: Line.ts:34
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
Returns
vec2
divideAtTimes()
divideAtTimes(
line,times):VertexL[]
Defined in: Line.ts:73
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
times | Iterable<number> |
Returns
VertexL[]
isZero()
isZero(
line):boolean
Defined in: Line.ts:85
Returns true if the length of line segment is zero.
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
Returns
boolean
length()
length(
line):number
Defined in: Line.ts:38
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
Returns
number
normal()
normal(
line):vec2
Defined in: Line.ts:46
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
Returns
vec2
of()
of(
start,point):SegmentL
Defined in: Line.ts:20
Parameters
| Parameter | Type |
|---|---|
start | vec2 |
point | vec2 |
Returns
offset()
offset(
line,distance):PathL
Defined in: Line.ts:89
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
distance | number |
Returns
orientation()
orientation(
line,loc):mat2d
Defined in: Line.ts:52
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
loc | SegmentLocation |
Returns
mat2d
point()
point(
line,loc):vec2
Defined in: Line.ts:29
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
loc | SegmentLocation |
Returns
vec2
tangent()
tangent(
line):vec2
Defined in: Line.ts:42
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
Returns
vec2
toTime()
toTime(
line,loc):number
Defined in: Line.ts:102
Converts a signed location to a time between 0 and 1.
Parameters
| Parameter | Type | Description |
|---|---|---|
line | BareSegmentL | |
loc | SegmentLocation |
Returns
number
trim()
trim(
line,start,end):SegmentL
Defined in: Line.ts:59
Parameters
| Parameter | Type |
|---|---|
line | BareSegmentL |
start | SegmentLocation |
end | SegmentLocation |