Constructor
new DefVector(params)
Constructor sets default values
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Methods
compute(createInfo) → {Object}
Computes the value of this definition
Parameters:
Name | Type | Description |
---|---|---|
createInfo |
CreateInfo |
- Source:
Returns:
The computed vector with type TYPE_VECTOR
- Type
- Object
(static) fromCoordinates(params) → {CreateInfo}
Creates a new vector from individual values
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromLineSegment(line, normalizeopt) → {CreateInfo}
Creates a new vector from a line segment
The vector will use the first line point as a reference and point to the second point
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
line |
Number | Object | Either the index or value of a TYPE_LINE. The line | |
normalize |
Number | Object |
<optional> |
Either the index or value of a TYPE_BOOLEAN. Whether the vector should be normalized |
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromPoints(p0, p1, normalizeopt) → {CreateInfo}
Creates a new vector from two points
The vector will use the first point as a reference and point to the second point
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
p0 |
Number | Object | Either the index or value of a TYPE_POINT. The first point | |
p1 |
Number | Object | Either the index or value of a TYPE_POINT. The second point | |
normalize |
Number | Object |
<optional> |
Either the index or value of a TYPE_BOOLEAN. Whether the vector should be normalized |
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromPolar(params) → {CreateInfo}
Creates a new vector from polar coordinates
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromPosition(params) → {CreateInfo}
Creates a new vector from the position vector of a point.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromRefVector(params) → {CreateInfo}
Creates a new vector from another vector and reference position.
If only a vector and no reference is given, the other vector's reference is used
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Returns:
The creation info
- Type
- CreateInfo