AutoOpenVec Module
When Euclid is opened this module will be auto-opened. It only contains extension members for type Vec.
Type extensions
| Type extension |
Description
|
|
Returns positive angle for rotating Counter-Clockwise from this vector to vector 'b' . In Diamond Angle. Using only proportion of X to Y components. Range of 0.0 to 4.0 (for 360 Degrees) It is the fastest angle calculation since it does not involve Cosine or ArcTangent functions. For World X-Y plane. Considers only the X and Y components of the vector.
Extended Type:
|
|
|
|
Cross product, of a 3D vector and a 3D unit-vectors. The resulting vector is perpendicular to both input vectors. The length of this resulting vector is the area of the parallelogram spanned by the input vectors. Its direction follows the right-hand rule. A x B = |A| * |B| * sin(angle)
Extended Type:
|
|
Cross product, of a 3D unit-vector and a 3D vectors. The resulting vector is perpendicular to both input vectors. The length of this resulting vector is the area of the parallelogram spanned by the input vectors. Its direction follows the right-hand rule. A x B = |A| * |B| * sin(angle)
Extended Type:
|
Full Usage:
this.Direction180InXY
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the angle in Degrees from X-axis, Ignores orientation. Range 0.0 to 180. For World X-Y plane. Considers only the X and Y components of the vector.
Extended Type:
|
Full Usage:
this.Direction2PiInXY
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the angle in Radians from X-axis, Going Counter-Clockwise till two Pi. For World X-Y plane. Considers only the X and Y components of the vector.
Extended Type:
|
Full Usage:
this.Direction360InXY
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the angle in Degrees from X-axis. Going Counter-Clockwise till 360. For World X-Y plane. Considers only the X and Y components of the vector.
Extended Type:
|
Full Usage:
this.DirectionDiamondInXY
Parameters:
unit
Returns: float
Modifiers: inline |
The diamond angle. Calculates the proportion of X to Y component. It is always positive and in the range of 0.0 to 4.0 (for 360 Degrees) 0.0 = Xaxis, going Counter-Clockwise. It is the fastest angle calculation since it does not involve Cosine or ArcTangent functions. For World X-Y plane. Considers only the X and Y components of the vector.
Extended Type:
|
Full Usage:
this.DirectionPiInXY
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the angle in Radians from X-axis, Ignores orientation. Range 0.0 to Pi. For World X-Y plane. Considers only the X and Y components of the vector.
Extended Type:
|
Full Usage:
this.IsHorizontal
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D vector is horizontal (Z component is almost zero). The absolute deviation tolerance along Z axis is 1e-9 (axisAlignmentTolerance). Fails on vectors shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsNotZero
Parameters:
unit
Returns: bool
Modifiers: inline |
Returns a boolean indicating if any of X, Y and Z is not exactly 0.0.
Extended Type:
|
|
|
|
Checks if the angle between this 3D vectors and a 3D unit-vector is more than 90 degrees. Calculates the dot product of a 3D vector and a unit-vectors. Then checks if it is smaller than -1e-12. Fails if the vector is shorter than zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
Vec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 3D vectors are parallel. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
UnitVec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 3D vectors and a 3D unit-vector are parallel. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
Vec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 3D vectors are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
UnitVec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 3D vectors and a 3D unit-vector are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
Vec
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 3D vectors are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
UnitVec
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 3D vectors and a 3D unit-vector are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsTiny
Parameters:
float
Returns: bool
Modifiers: inline |
Check if the 3D vector is shorter than the tolerance. Also checks if any component is a NaN.
Extended Type:
|
Full Usage:
this.IsTinySq
Parameters:
float
Returns: bool
Modifiers: inline |
Check if the 3D vectors square length is shorter than the squared tolerance. Also checks if any component is a NaN.
Extended Type:
|
Full Usage:
this.IsUnit
Parameters:
unit
Returns: bool
Modifiers: inline |
Test if the 3D vector is a unit-vector. Test if the vectors square length is within 6 float steps of 1.0 So between 0.99999964 and 1.000000715.
Extended Type:
|
Full Usage:
this.IsVertical
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D vector is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9 (axisAlignmentTolerance). Fails on vectors shorter than 1e-6. Same as v.IsZAligned
Extended Type:
|
Full Usage:
this.IsXAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D vector is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y and Z axis is 1e-9 (axisAlignmentTolerance). Fails on vectors shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsYAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D vector is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X and Z axis is 1e-9 (axisAlignmentTolerance). Fails on vectors shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsZAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D vector is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9 (axisAlignmentTolerance). Fails on vectors shorter than 1e-6. Same as v.IsVertical
Extended Type:
|
Full Usage:
this.IsZero
Parameters:
unit
Returns: bool
Modifiers: inline |
Returns a boolean indicating whether X, Y and Z are all exactly 0.0.
Extended Type:
|
Full Usage:
this.LengthInXY
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the length of the 3D vector projected into World X-Y plane.
Extended Type:
|
Full Usage:
this.LengthSqInXY
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the squared length of the 3D vector projected into World X-Y plane. The square length is faster to calculate and often good enough for use cases such as sorting vectors by length.
Extended Type:
|
|
|
|
|
|
|
Full Usage:
this.RotateByQuarterCircle
Parameters:
int
Returns: Vec
Modifiers: inline |
Rotates the 3D vector around the Z-axis by a given number of quarter-circles (i.e. multiples of 90 degrees or Pi/2 radians). A positive number rotates counter-clockwise, a negative number rotates clockwise. The length of the vector is preserved.
Extended Type:
|
|
|
|
|
|
|
|
Multiplies (or applies) a RigidMatrix to a 3D vector. Since a 3D vector represents a direction or translation in space, but not a location, all translations are ignored. (Homogeneous Vector)
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns positive angle for rotating Counter-Clockwise from vector 'a' to vector 'b' . In Diamond Angle. Using only proportion of X to Y components. Range of 0.0 to 4.0 (for 360 Degrees) It is the fastest angle calculation since it does not involve Cosine or ArcTangent functions. For World X-Y plane. Considers only the X and Y components of the vector.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Vec.create (x, y, z)
Parameters:
float
y : float
z : float
Returns: Vec
Modifiers: inline |
|
|
|
Full Usage:
Vec.createFromMembersXYZ vec
Parameters:
^T
Returns: Vec
Modifiers: inline Type parameters: ^T, ^a, ^b, ^c |
|
Full Usage:
Vec.createFromMembersxyz vec
Parameters:
^T
Returns: Vec
Modifiers: inline Type parameters: ^T, ^a, ^b, ^c |
|
|
|
|
|
|
|
|
Cross product, of a 3D unit-vectors and a 3D vector. It is also known as the Determinant, Wedge Product or Outer Product. The resulting vector is perpendicular to both input vectors. The length of this resulting vector is the area of the parallelogram spanned by the input vectors. Its direction follows the right-hand rule. A x B = |A| * |B| * sin(angle)
Extended Type:
|
|
Cross product, of a 3D vector and a 3D unit-vectors. It is also known as the Determinant, Wedge Product or Outer Product. The resulting vector is perpendicular to both input vectors. The length of this resulting vector is the area of the parallelogram spanned by the input vectors. Its direction follows the right-hand rule. A x B = |A| * |B| * sin(angle)
Extended Type:
|
|
Returns three vector's Determinant. This is also the signed volume of the Parallelepipeds define by these three vectors. Also called scalar triple product, mixed product, Box product, or in German: Spatprodukt. It is defined as the dot product of one of the vectors with the Cross Product of the other two.
Extended Type:
|
|
|
|
|
|
|
|
|
|
The diamond angle. Returns positive angle of 3D vector in World X-Y plane. Calculates the proportion of X to Y component. It is always positive and in the range of 0.0 to 4.0 (for 360 Degrees) 0.0 = Xaxis, going Counter-Clockwise. It is the fastest angle calculation since it does not involve Cosine or ArcTangent functions. For World X-Y plane. Considers only the X and Y components of the vector.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Vec.isAngleAbove cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vec
b : Vec
Returns: bool
Modifiers: inline |
Checks if the angle between two vectors is bigger than a threshold angle specified as a precomputed cosine value. Considers the vector orientation too. So the angle is between 0 to 180 degrees. Use the Euclid.Cosine module to get some precomputed cosine values Fails on tiny vectors shorter than 1e-12. Use Vec.isNotParallelWithin to ignore vector orientation.
Extended Type:
|
Full Usage:
Vec.isAngleBelow cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vec
b : Vec
Returns: bool
Modifiers: inline |
Checks if the angle between two vectors is smaller than a threshold angle specified as a precomputed cosine value. Considers the vector orientation too. So the angle is between 0 to 180 degrees. Use the Euclid.Cosine module to get some precomputed cosine values Fails on tiny vectors shorter than 1e-12. Use Vec.isParallelWithin to ignore vector orientation.
Extended Type:
|
|
|
Full Usage:
Vec.isNotParallelWithin cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vec
b : Vec
Returns: bool
Modifiers: inline |
Checks if the angle between two vectors is bigger than a threshold angle specified as a precomputed cosine value. Ignores vector orientation. So the angle is between 0 to 90 degrees ignoring their orientation. Use the Euclid.Cosine module to get some precomputed cosine values Fails on tiny vectors shorter than 1e-12. Use Vec.isAngleAbove for considering vector orientation.
Extended Type:
|
|
|
Full Usage:
Vec.isParallelWithin cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vec
b : Vec
Returns: bool
Modifiers: inline |
Checks if the angle between two vectors is smaller than a threshold angle specified as a precomputed cosine value. Ignores vector orientation. So the angle is between 0 to 90 degrees ignoring their orientation. Use the Euclid.Cosine module to get some precomputed cosine values Fails on tiny vectors shorter than 1e-12. Use Vec.isAngleBelow for considering vector orientation.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns a vector that is perpendicular to the given vector and in the same vertical Plane. Projected into the X-Y plane input and output vectors are parallel and of same orientation. Not of same length, not unitized. On vertical input vector resulting vector if of zero length.
Extended Type:
|
|
|
|
|
|
|
|
Rotates a 3D vector around the Z-axis by a given number of quarter-circles (i.e. multiples of 90 degrees or Pi/2 radians). A positive number rotates counter-clockwise, a negative number rotates clockwise. The length of the vector is preserved.
Extended Type:
|
Full Usage:
Vec.rotateByQuaternion q v
Parameters:
Quaternion
v : Vec
Returns: Vec
Modifiers: inline |
|
|
|
|
|
|
|
|
Rotate the 3D vector around X-axis, from Y to Z-axis, Counter Clockwise looking from right.
Extended Type:
|
|
|
|
Rotate the 3D vector around Y-axis, from Z to X-axis, Counter Clockwise looking from back.
Extended Type:
|
|
|
|
Rotate the 3D vector around Z-axis, from X to Y-axis, Counter Clockwise looking from top.
Extended Type:
|
|
|
|
Spherically interpolates between start and end by amount rel (0.0 to 1.0). The difference between this and linear interpolation (aka, "lerp") is that the vectors are treated as directions rather than points in space. The direction of the returned vector is interpolated by the angle and its magnitude is interpolated between the magnitudes of start and end. Interpolation continues before and after the range of 0.0 and 0.1
Extended Type:
|
|
|
|
|
|
|
|
|
Full Usage:
Vec.transformRigid m v
Parameters:
RigidMatrix
v : Vec
Returns: Vec
Modifiers: inline |
Multiplies (or applies) a RigidMatrix to a 3D vector. Since a 3D vector represents a direction or translation in space, but not a location, all translations are ignored. (Homogeneous Vector)
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Euclid