Constructor
new DefNormalVector(params)
Constructor sets default values
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Methods
compute(createInfo) → {Object}
Computes the normal vector value
Parameters:
Name | Type | Description |
---|---|---|
createInfo |
CreateInfo | The create information |
- Source:
Returns:
The normal with type TYPE_VECTOR
- Type
- Object
(static) circleNormal(p, center, r) → {Object}
Computes the normal of a point with respect to a circle.
Will be scaled according to 2 / r^2 [x,y]
Parameters:
Name | Type | Description |
---|---|---|
p |
Object | The point |
center |
Object | The circle center |
r |
Number | The circle radius |
- Source:
Returns:
The circle normal
- Type
- Object
(static) ellipseNormal(p, center, rx, ry, rotation) → {Object}
Computes the normal of a point with respect to an ellipse.
Will be scaled according to [2x / rx^2 , 2y / ry^2]
Parameters:
Name | Type | Description |
---|---|---|
p |
Object | The point |
center |
Object | The ellipse center |
rx |
Number | The ellipse x-eccentricity |
ry |
Number | The ellipse y-eccentricity |
rotation |
Number | The ellipse rotation |
- Source:
Returns:
The normal
- Type
- Object
(static) fromArc(p, arc, normalizeopt) → {CreateInfo}
Creates a normal at a point with respect to the given arc/circle.
The point is the reference point as well.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
p |
Number | Object | Either the index or value of a TYPE_POINT. The point | |
arc |
Number | Object | Either the index or value of a TYPE_ARC. The circle | |
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) fromCoordinates(params) → {CreateInfo}
Creates a new normal vector from individual vector components
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromEllipse(p, ellipse, normalizeopt) → {CreateInfo}
Creates a normal at a point with respect to the given ellipse.
The point is the reference point as well.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
p |
Number | Object | Either the index or value of a TYPE_POINT. The point | |
ellipse |
Number | Object | Either the index or value of a TYPE_ELLIPSE. The ellipse | |
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) fromLine(line, normalizeopt) → {CreateInfo}
Creates a new normal 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) fromPointCoordinates(params) → {CreateInfo}
Creates a new normal vector from the position vector of a point.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromPoints(params) → {CreateInfo}
Creates a new normal vector from two points
The vector will use the first point as a reference and point to the second point
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) fromVector(params) → {CreateInfo}
Creates a new normal vector from another vector.
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