Vec2d
Public Class
Table of Contents
- Properties
- Methods
- abs
- Abs
- add
- Add
- addScalar
- AddScalar
- addXY
- AddXY
- angle
- Angle
- Average
- Cast
- clamp
- Clamp
- Clockwise
- clone
- cpr
- Cpr
- cross
- Cross
- dist
- Dist
- Dist2
- distanceToLineSegment
- DistanceToLineSegment
- DistanceToLineThroughPoint
- div
- Div
- divV
- DivV
- dpr
- Dpr
- equals
- Equals
- equalsXY
- EqualsXY
- From
- FromArray
- len
- Len
- len2
- Len2
- lrp
- Lrp
- Max
- Med
- Min
- mul
- Mul
- mulV
- MulV
- NearestPointOnLineSegment
- NearestPointOnLineThroughPoint
- neg
- Neg
- norm
- nudge
- Nudge
- per
- Per
- PointsBetween
- pry
- Pry
- Rescale
- rot
- Rot
- rotWith
- RotWith
- ScaleWithOrigin
- set
- setTo
- slope
- Slope
- Snap
- snapToGrid
- SnapToGrid
- sub
- Sub
- subScalar
- SubScalar
- subXY
- SubXY
- tan
- Tan
- toAngle
- ToAngle
- toArray
- ToArray
- toFixed
- ToFixed
- toJson
- ToJson
- toString
- ToString
- uni
- Uni
Signature
class Vec2d {}
Constructor
Public Constructor
Constructs a new instance of the Vec2d
class
Parameters
Name | Description |
---|---|
(optional) |
|
(optional) |
|
(optional) |
|
Properties
pressure
Public Readonly Property
Signature
get pressure(): number
x
Public Property
Signature
x: number
y
Public Property
Signature
y: number
z
Public Property
Signature
z: number
Methods
abs()
Public Method
Parameters
None
Returns
this
Abs()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
add()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
References
Add()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
addScalar()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
AddScalar()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
addXY()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
this
AddXY()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
Vec2d
References
angle()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
Angle()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
Average()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
Cast()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
clamp()
Public Method
Parameters
Name | Description |
---|---|
|
|
(optional) |
|
Returns
this
Clamp()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
(optional) |
|
Returns
Vec2d
References
Clockwise()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
boolean
References
clone()
Public Method
Parameters
None
Returns
Vec2d
References
cpr()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
Cpr()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
cross()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
References
Cross()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
dist()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
Dist()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
Dist2()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
distanceToLineSegment()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
DistanceToLineSegment()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
(optional) |
|
Returns
number
References
DistanceToLineThroughPoint()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
number
References
div()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
Div()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
divV()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
References
DivV()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
dpr()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
Dpr()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
equals()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
boolean
References
Equals()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
boolean
References
equalsXY()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
boolean
EqualsXY()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
boolean
References
From()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
FromArray()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
len()
Public Method
Parameters
None
Returns
number
Len()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
len2()
Public Method
Parameters
None
Returns
number
Len2()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
lrp()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
Lrp()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
Vec2d
References
Max()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
Med()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
Min()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
mul()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
Mul()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
mulV()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
References
MulV()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
NearestPointOnLineSegment()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
(optional) |
|
Returns
Vec2d
References
NearestPointOnLineThroughPoint()
Public Static Method
Get the nearest point on a line with a known unit vector that passes through point A
Vec.nearestPointOnLineThroughPoint(A, u, Point)
Parameters
Name | Description |
---|---|
|
Any point on the line |
|
The unit vector for the line. |
|
A point not on the line to test. |
Returns
Vec2d
References
neg()
Public Method
Parameters
None
Returns
this
Neg()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
norm()
Public Method
Parameters
None
Returns
this
nudge()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
this
References
Nudge()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
Vec2d
References
per()
Public Method
Parameters
None
Returns
this
Per()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
PointsBetween()
Public Static Method
Get an array of points (with simulated pressure) between two points.
Parameters
Name | Description |
---|---|
|
The first point. |
|
The second point. |
(optional) |
The number of points to return. |
Returns
Vec2d[]
References
pry()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
Pry()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
Rescale()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
rot()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
Rot()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
(optional) |
|
Returns
Vec2d
References
rotWith()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
this
References
RotWith()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
Vec2d
References
ScaleWithOrigin()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
Vec2d
References
set()
Public Method
Parameters
Name | Description |
---|---|
(optional) |
|
(optional) |
|
(optional) |
|
Returns
this
setTo()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
References
slope()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
Slope()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
Snap()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
(optional) |
|
Returns
Vec2d
References
snapToGrid()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
SnapToGrid()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
(optional) |
|
Returns
Vec2d
References
sub()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
References
Sub()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
subScalar()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
SubScalar()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
subXY()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
this
SubXY()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
Vec2d
References
tan()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
Tan()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec2d
References
toAngle()
Public Method
Parameters
None
Returns
number
ToAngle()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
toArray()
Public Method
Parameters
None
Returns
number[]
ToArray()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
number[]
References
toFixed()
Public Method
Parameters
None
Returns
Vec2d
References
ToFixed()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
(optional) |
|
Returns
Vec2d
References
toJson()
Public Method
Parameters
None
Returns
Vec2dModel
References
ToJson()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
{
x: number
y: number
z: number | undefined
}
References
toString()
Public Method
Parameters
None
Returns
string
ToString()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
string
References
uni()
Public Method
Parameters
None
Returns
Vec2d
References
Uni()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d