Methods
compute(info)
Computes the specified operation
Parameters:
Name | Type | Description |
---|---|---|
info |
CreateInfo | The creation info |
- Source:
Returns:
The result of the operation of the type specified for the different from methods
(static) fromAttach(a, b, refopt) → {CreateInfo}
Attaches the second vector at the tip of the first.
The result is a vector that points from the first vector's reference point to the tip of the second.
Optionally, a new reference point may be specified.
The result will be of type TYPE_VECTOR
NOTE: This will be equivalent to adding the vectors and placing them at the reference, if they share the same reference point.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
a |
Number | Object | Either the index or value of a TYPE_VECTOR. The first vector | |
b |
Number | Object | Either the index or value of a TYPE_VECTOR. The vector to be attached | |
ref |
Number | Object |
<optional> |
Either the index or value of a TYPE_POINT. The new reference |
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromDot(a, b) → {CreateInfo}
Computes the dot product of two vectors.
The result will be of type TYPE_NUMBER
Parameters:
Name | Type | Description |
---|---|---|
a |
Number | Object | Either the index or value of a TYPE_VECTOR. The first vector |
b |
Number | Object | Either the index or value of a TYPE_VECTOR. The second vector |
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromNegate(a, attachAtEndPointopt) → {CreateInfo}
Negates the given vectors
Optionally, the reference point can be switched to the old arrow tip, so the arrow overall stays in the same place
The result will be of type TYPE_VECTOR
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
a |
Number | Object | Either the index or value of a TYPE_VECTOR. The vector | ||
attachAtEndPoint |
Boolean |
<optional> |
false | Whether or not the new vector will be attached at the old arrow tip |
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromTransform(a, params, defaultValuesopt) → {CreateInfo}
Transforms a given vector by rotation and scaling
Optionally, a new reference point may be specified.
The result will be of type TYPE_VECTOR
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a |
Number | Object | Either the index or value of a TYPE_VECTOR. The vector | |||||||||||||||||||||
params |
Object |
Properties
|
|||||||||||||||||||||
defaultValues |
Object |
<optional> |
Properties
|
- Source:
Returns:
The creation info
- Type
- CreateInfo