AutoOpenUnitVec Module
When Euclid is opened this module will be auto-opened. It only contains extension members for type UnitVec.
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 two 3D unit-vectors. The resulting vector is perpendicular to both input vectors. The length of this resulting vector is the squared area of the parallelogram spanned by the input vectors. Or the sine of the angle between the two unit-vectors. Its direction follows the right-hand rule. A x B = |A| * |B| * sin(angle)
Extended Type:
|
|
Cross product, of a 3D unit-vectors an a 3D vector. The resulting vector is perpendicular to both input vectors. The length of this resulting vector is the squared 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.Direction180InXY
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. Fails if vector is vertical.
Extended Type:
|
Full Usage:
this.Direction2PiInXY
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. Fails if vector is vertical.
Extended Type:
|
Full Usage:
this.Direction360InXY
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the angle in Degrees from X-axis in World X-Y plane. 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.Direction360InXY
Returns: float
Modifiers: inline |
Returns the angle in Degrees from X-axis in World X-Y plane. 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 is always positive and in the range of 0.0 to 4.0 (for 360 Degrees) 0.0 = Xaxis, going Counter-Clockwise. Ignoring Z component. This is the fastest angle computation since it does not use Math.Cos or Math.Sin. It is useful for radial sorting. For X-Y plane. Considers only the X and Y components of the vector.
Extended Type:
|
Full Usage:
this.DirectionDiamondInXY
Returns: float
Modifiers: inline |
The diamond angle is always positive and in the range of 0.0 to 4.0 (for 360 Degrees) 0.0 = Xaxis, going Counter-Clockwise. Ignoring Z component. This is the fastest angle computation since it does not use Math.Cos or Math.Sin. It is useful for radial sorting. For 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 in World X-Y plane, Ignores orientation. Range 0.0 to Pi. For World X-Y plane. Considers only the X and Y components of the vector. Fails if vector is vertical.
Extended Type:
|
Full Usage:
this.DirectionPiInXY
Returns: float
Modifiers: inline |
Returns the angle in Radians from X-axis in World X-Y plane, Ignores orientation. Range 0.0 to Pi. For World X-Y plane. Considers only the X and Y components of the vector. Fails if vector is vertical.
Extended Type:
|
Full Usage:
this.DotCosine
Parameters:
UnitVec
Returns: float<MeasureProduct<cosine, MeasureOne>>
Modifiers: inline |
Dot product, or scalar product of two 3D unit-vector. This float of unit-vectors is the Cosine of the angle between the two vectors. Returns a float with a unit of Measure Euclid.Cosine.cosine. This is useful for comparing the angle to precomputed values in the Euclid.Cosine module.
Extended Type:
|
Full Usage:
this.IsHorizontal
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is horizontal (Z component is almost zero). The absolute deviation tolerance along Z axis is 1e-9. Fails on vectors shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsHorizontal
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is horizontal (Z component is almost zero). The absolute deviation tolerance along Z axis is 1e-9. Fails on vectors shorter than 1e-6.
Extended Type:
|
|
|
|
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
UnitVec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 3D unit-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 minium cosine value. See Euclid.Cosine module.
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
Vec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 3D unit-vectors and a 3D 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 minium cosine value. See Euclid.Cosine module.
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
UnitVec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 3D unit-vectors are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module.
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
Vec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 3D unit-vectors and a 3D vector are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module.
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
UnitVec
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 3D unit-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 minium cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module.
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
Vec
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 3D unit-vectors and a 3D 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 minium cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module.
Extended Type:
|
Full Usage:
this.IsVertical
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9. Same as v.IsZAligned
Extended Type:
|
Full Usage:
this.IsVertical
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9. Same as v.IsZAligned
Extended Type:
|
Full Usage:
this.IsXAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y and Z axis is 1e-9.
Extended Type:
|
Full Usage:
this.IsXAligned
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y and Z axis is 1e-9.
Extended Type:
|
Full Usage:
this.IsYAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X and Z axis is 1e-9.
Extended Type:
|
Full Usage:
this.IsYAligned
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X and Z axis is 1e-9.
Extended Type:
|
Full Usage:
this.IsZAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9. Same as v.IsVertical
Extended Type:
|
Full Usage:
this.IsZAligned
Returns: bool
Modifiers: inline |
Checks if 3D unit-vector is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9. Same as v.IsVertical
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.LengthInXY
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.LengthSqInXY
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Multiplies a Matrix with a 3D vector. Since a 3D vector represents a direction or an offset in space, but not a location, the implicit the 4th dimension is 0.0 so that all translations are ignored. (Homogeneous Vector) The resulting vector is not unitized.
Extended Type:
|
|
Multiplies (or applies) a RigidMatrix to a 3D unit-vector. Since a 3D vector represents a direction or an offset 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:
UnitVec.createFromMembersXYZ vec
Parameters:
^T
Returns: UnitVec
Modifiers: inline Type parameters: ^T, ^a, ^b, ^c |
|
Full Usage:
UnitVec.createFromMembersxyz vec
Parameters:
^T
Returns: UnitVec
Modifiers: inline Type parameters: ^T, ^a, ^b, ^c |
|
|
|
|
|
|
Cross product, of a 3D unit-vectors an 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 squared 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 squared 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 vectors 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 unit-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:
UnitVec.dotCosine a b
Parameters: Returns: float<MeasureProduct<cosine, MeasureOne>>
Modifiers: inline |
Dot product, or scalar product of two 3D unit-vector. This float of unit-vectors is the Cosine of the angle between the two vectors. Returns a float with a unit of Measure Euclid.Cosine.cosine. This is useful for comparing the angle to precomputed values in the Euclid.Cosine module.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
UnitVec.intersection (ptA, ptB, vA, vB, relAngleDiscriminant)
Parameters:
Pnt
-
The start point of the first line.
ptB : Pnt
-
The start point of the second line.
vA : UnitVec
-
The unit-vector of the first line.
vB : UnitVec
-
The unit-vector of the second line.
relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>>
-
This is an optional tolerance for the internally calculated relative Angle Discriminant.
The default value corresponds to approx 0.25 degree. Below this angle vectors are considered parallel.
Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.
Returns: ValueOption<float * float>
For (almost) zero length or (almost) parallel vectors: ValueNone
Else ValueSome with a tuple of the parameters at which the two infinite 2D lines intersect to each other.
The tuple's order corresponds to the input order.
Modifiers: inline |
Intersects two infinite 3D lines. The lines are defined by a start point and a vector. 'ValueNone' is returned, if the angle between the vectors is less than 0.25 degrees or any of them is shorter than 1e-6. These tolerances can be adjusted with optional parameters.
Extended Type:
|
Full Usage:
UnitVec.isAngle180Above cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : UnitVec
b : UnitVec
Returns: bool
Modifiers: inline |
Checks if Angle between two unit-vectors is more than given Cosine. Does not ignores vector orientation.The angle between two vectors can be 0 to 180 degrees. Use the Euclid.Cosine module to get some precomputed cosine values.
Extended Type:
|
Full Usage:
UnitVec.isAngle180Below cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : UnitVec
b : UnitVec
Returns: bool
Modifiers: inline |
Checks if Angle between two unit-vectors is less than given Cosine. Does not ignores vector orientation. The angle between two vectors can be 0 to 180 degrees. Use the Euclid.Cosine module to get some precomputed cosine values.
Extended Type:
|
Full Usage:
UnitVec.isAngle90Above cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : UnitVec
b : UnitVec
Returns: bool
Modifiers: inline |
Checks if Angle between two unit-vectors is more than given Cosine. Ignores vector orientation. The angle between two vectors can be 0 to 90 degrees ignoring their direction. Use the Euclid.Cosine module to get some precomputed cosine values.
Extended Type:
|
Full Usage:
UnitVec.isAngle90Below cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : UnitVec
b : UnitVec
Returns: bool
Modifiers: inline |
Checks if Angle between two unit-vectors is less than given Cosine. Ignores vector orientation. The angle between two vectors can be 0 to 90 degrees ignoring their direction. Use the Euclid.Cosine module to get some precomputed cosine values.
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:
|
|
|
|
|
|
|
Full Usage:
UnitVec.rotateByQuaternion q v
Parameters:
Quaternion
v : UnitVec
Returns: UnitVec
Modifiers: inline |
|
|
|
|
|
|
|
Full Usage:
UnitVec.rotateXBy r v
Parameters:
Rotation2D
v : UnitVec
Returns: UnitVec
Modifiers: inline |
Rotate the 3D unit-vector around X-axis, from Y to Z-axis, Counter Clockwise looking from right.
Extended Type:
|
|
|
Full Usage:
UnitVec.rotateYBy r v
Parameters:
Rotation2D
v : UnitVec
Returns: UnitVec
Modifiers: inline |
Rotate the 3D unit-vector around Y-axis, from Z to X-axis, Counter Clockwise looking from back.
Extended Type:
|
|
|
Full Usage:
UnitVec.rotateZBy r v
Parameters:
Rotation2D
v : UnitVec
Returns: UnitVec
Modifiers: inline |
Rotate the 3D unit-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:
UnitVec.transformRigid m v
Parameters:
RigidMatrix
v : UnitVec
Returns: UnitVec
Modifiers: inline |
Multiplies (or applies) a RigidMatrix to a 3D unit-vector. Since a 3D vector represents a direction or an offset in space, but not a location, all translations are ignored. (Homogeneous Vector) The resulting vector is unitized too.
Extended Type:
|
|
|
|
|
|
|
|