AutoOpenVc Module
When Euclid is opened this module will be auto-opened. It only contains extension members for type Vc.
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.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
this.Direction180
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the angle in Degrees from X-axis, Ignores orientation. Range 0.0 to 180.
Extended Type:
|
Full Usage:
this.Direction180
Returns: float
Modifiers: inline |
Returns the angle in Degrees from X-axis, Ignores orientation. Range 0.0 to 180.
Extended Type:
|
Full Usage:
this.Direction2Pi
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the angle in Radians from X-axis. Going Counter-Clockwise till two Pi.
Extended Type:
|
Full Usage:
this.Direction2Pi
Returns: float
Modifiers: inline |
Returns the angle in Radians from X-axis. Going Counter-Clockwise till two Pi.
Extended Type:
|
Full Usage:
this.Direction360
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the angle in Degrees from X-axis. Going Counter-Clockwise till 360.
Extended Type:
|
Full Usage:
this.Direction360
Returns: float
Modifiers: inline |
Returns the angle in Degrees from X-axis. Going Counter-Clockwise till 360.
Extended Type:
|
Full Usage:
this.DirectionDiamond
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.
Extended Type:
|
Full Usage:
this.DirectionDiamond
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.
Extended Type:
|
Full Usage:
this.DirectionPi
Parameters:
unit
Returns: float
Modifiers: inline |
Returns the angle in Radians from X-axis. Going Counter-Clockwise till two Pi. Ignores orientation. Range 0.0 to Pi.
Extended Type:
|
Full Usage:
this.DirectionPi
Returns: float
Modifiers: inline |
Returns the angle in Radians from X-axis. Going Counter-Clockwise till two Pi. Ignores orientation. Range 0.0 to Pi.
Extended Type:
|
Full Usage:
this.IsNotZero
Parameters:
unit
Returns: bool
Modifiers: inline |
Returns a boolean indicating if any of X and Y is not exactly 0.0.
Extended Type:
|
Full Usage:
this.IsNotZero
Returns: bool
Modifiers: inline |
|
|
|
|
Checks if the angle between this 2D vectors and a 2D unit-vector is more than 180 degrees. Calculates the dot product of a 2D vector and a unit-vectors. Then checks if it is smaller than minus 1e-12. Fails if the vector is shorter than zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
Vc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D 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. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
UnitVc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks this 2D vectors and a 2D 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 minium cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
Vc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D 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. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
UnitVc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 2D vectors and a 2D unit-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. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
Vc
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D 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. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
UnitVc
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 2D vectors and a 2D 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 minium 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 2D 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 2D 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 2D vector is a unit-vector. Tests if square length is within 6 float steps of 1.0 So between 0.99999964 and 1.000000715.
Extended Type:
|
Full Usage:
this.IsUnit
Returns: bool
Modifiers: inline |
Test if the 2D vector is a unit-vector. Tests if square length is within 6 float steps of 1.0 So between 0.99999964 and 1.000000715.
Extended Type:
|
Full Usage:
this.IsXAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 2D vector is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y axis is 1e-9. Fails on vectors shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsXAligned
Returns: bool
Modifiers: inline |
Checks if 2D vector is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y axis is 1e-9. Fails on vectors shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsYAligned
Parameters:
unit
Returns: bool
Modifiers: inline |
Checks if 2D vector is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X axis is 1e-9. Fails on vectors shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsYAligned
Returns: bool
Modifiers: inline |
Checks if 2D vector is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X axis is 1e-9. Fails on vectors shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsZero
Parameters:
unit
Returns: bool
Modifiers: inline |
Returns a boolean indicating wether X and Y are exactly 0.0.
Extended Type:
|
Full Usage:
this.IsZero
Returns: bool
Modifiers: inline |
|
|
|
|
Checks if the angle between this 2D vectors and a 2D unit-vector is less than 180 degrees. Calculates the dot product of a 2D vector and a unit-vectors. Then checks if it is bigger than 1e-12. Fails if the vector is shorter than zeroLengthTolerance (1e-12).
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
Rotate the a 2D vector Counter Clockwise by a 2D Rotation (that has cos and sin precomputed)
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.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Vc.createFromMembersXY vec
Parameters:
^T
Returns: Vc
Modifiers: inline Type parameters: ^T, ^a, ^b |
|
Full Usage:
Vc.createFromMembersxy vec
Parameters:
^T
Returns: Vc
Modifiers: inline Type parameters: ^T, ^a, ^b |
|
|
|
|
|
|
The 2D Cross Product. It is also known as the Determinant, Wedge Product or Outer Product. It is just a scalar equal to the signed square area of the parallelogram spanned by the input vectors. If the rotation from 'a' to 'b' is Counter-Clockwise the result is positive.
Extended Type:
|
|
The 2D Cross Product. It is also known as the Determinant, Wedge Product or Outer Product. It is just a scalar equal to the signed square area of the parallelogram spanned by the input vectors. If the rotation from 'a' to 'b' is Counter-Clockwise the result is positive.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
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.
Extended Type:
|
|
|
|
|
|
|
|
|
Full Usage:
Vc.intersection (ptA, ptB, vA, vB, tooShortTolerance, relAngleDiscriminant)
Parameters:
Pt
-
The start point of the first line.
ptB : Pt
-
The start point of the second line.
vA : Vc
-
The vector of the first line.
vB : Vc
-
The vector of the second line.
tooShortTolerance : float
-
Is an optional length tolerance. 1e-6 by default.
If one or both vectors are shorter than this ValueNone is returned.
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.
See module Euclid.UtilEuclid.RelAngleDiscriminant
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.
|
Intersects two infinite 2D lines. The lines are defined by a start point and a vector.
Extended Type:
|
Full Usage:
Vc.isAngle180Above cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vc
b : Vc
Returns: bool
Modifiers: inline |
Checks if Angle between two 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. Fails on zero length vectors, tolerance 1e-12.
Extended Type:
|
Full Usage:
Vc.isAngle180Below cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vc
b : Vc
Returns: bool
Modifiers: inline |
Checks if Angle between two 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 Fails on zero length vectors, tolerance 1e-12.
Extended Type:
|
Full Usage:
Vc.isAngle90Above cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vc
b : Vc
Returns: bool
Modifiers: inline |
Checks if Angle between two 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. Fails on zero length vectors, tolerance 1e-12.
Extended Type:
|
Full Usage:
Vc.isAngle90Below cosineValue a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vc
b : Vc
Returns: bool
Modifiers: inline |
Checks if Angle between two 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 Fails on zero length vectors, tolerance 1e-12.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rotate the a 2D vector Counter Clockwise by a 2D Rotation (that has cos and sin precomputed)
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|