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. The static counterpart is Vc.angleDiamond.
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.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.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.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.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.IsNotZero
Parameters:
unit
Returns: bool
Modifiers: inline |
Returns a boolean indicating if any of X and Y is not exactly 0.0. If any of the components is NaN, this will also return TRUE.
Extended Type:
|
|
|
|
Checks if the angle between this 2D vector and a 2D unit-vector is more than 90 degrees. Calculates the dot product of a 2D 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:
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 minimum cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Vc.areParallelAndOriented.
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
UnitVc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks this 2D vector 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 minimum cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Vc.isParallelAndOrientedToUnitVc.
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 minimum cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Vc.areParallel.
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
UnitVc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 2D vector 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 minimum cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Vc.isParallelToUnitVc.
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 maximum cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Vc.arePerpendicular.
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
UnitVc
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if this 2D vector 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 maximum cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Vc.isPerpendicularToUnitVc.
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 the squared length is between 0.999999 and 1.000001 (1e-6 tolerance).
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 the Y-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 2D vector is parallel to the world Y-axis. Ignoring orientation. The absolute deviation tolerance along the X-axis is 1e-9 (axisAlignmentTolerance). Fails on vectors shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsZero
Parameters:
unit
Returns: bool
Modifiers: inline |
Returns a boolean indicating whether X and Y are exactly 0.0.
Extended Type:
|
|
|
|
Checks if the angle between this 2D vector and a 2D unit-vector is less than 90 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:
|
Full Usage:
this.Rotate
Parameters:
Rotation2D
-
The rotation to apply.
Returns: Vc
The rotated 2D vector.
Modifiers: inline |
Rotate the 2D vector counter-clockwise by a 2D Rotation (that has cos and sin precomputed).
Extended Type:
|
|
|
|
|
Full Usage:
this.RotateByQuarterCircle
Parameters:
int
Returns: Vc
Modifiers: inline |
|
Full Usage:
this.RotateDegrees
Parameters:
float
-
The rotation angle in degrees.
Returns: Vc
The rotated 2D vector.
Modifiers: inline |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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. The instance counterpart is Vc.AngleDiamondTo.
Extended Type:
|
|
|
|
|
|
|
|
|
Full Usage:
Vc.areParallel minCosine a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vc
b : Vc
Returns: bool
Modifiers: inline |
Checks if two 2D vectors are parallel. Ignoring orientation. Use a precomputed value from Euclid.Cosine module as tolerance. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Vc.IsParallelTo.
Extended Type:
|
Full Usage:
Vc.areParallelAndOriented minCosine a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vc
b : Vc
Returns: bool
Modifiers: inline |
Checks if two 2D vectors are parallel and orientated the same way. Use a precomputed value from Euclid.Cosine module as tolerance. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Vc.IsParallelAndOrientedTo.
Extended Type:
|
Full Usage:
Vc.arePerpendicular maxCosine a b
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
a : Vc
b : Vc
Returns: bool
Modifiers: inline |
Checks if two 2D vectors are perpendicular to each other. Use a precomputed value from Euclid.Cosine module as tolerance. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Vc.IsPerpendicularTo.
Extended Type:
|
|
|
|
|
|
|
|
|
Full Usage:
Vc.createFromMembersXY vec
Parameters:
^T
Returns: Vc
Modifiers: inline Type parameters: ^T, ^a, ^b (requires (member get_X : ^T -> ^a) and (member get_Y : ^T -> ^b) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float)) |
|
Full Usage:
Vc.createFromMembersxy vec
Parameters:
^T
Returns: Vc
Modifiers: inline Type parameters: ^T, ^a, ^b (requires (member get_x : ^T -> ^a) and (member get_y : ^T -> ^b) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
|
|
Checks if two 2D vectors are equal within tolerance. Identical vectors in opposite directions are not considered equal. The tolerance applies to the X and Y components separately, not to the Euclidean distance between the tips. Use Vc.equalsExact to check for an exact match.
Extended Type:
|
|
|
|
|
Full Usage:
Vc.isParallelAndOrientedToUnitVc minCosine other vector
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
-
Minimum cosine of the angle, exclusive.
other : UnitVc
-
The unit-vector to compare with.
vector : Vc
-
The vector to test.
Returns: bool
TRUE when parallel within the tolerance and similarly oriented.
Modifiers: inline |
Tests parallelism with matching orientation. Fails for vectors shorter than 1e-12. The instance counterpart is Vc.IsParallelAndOrientedTo.
Extended Type:
|
Full Usage:
Vc.isParallelToUnitVc minCosine b a
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
b : UnitVc
a : Vc
Returns: bool
Modifiers: inline |
Checks if this 2D vector and a 2D unit-vector are parallel. Ignores the line orientation. This tolerance can be customized by an optional minimum cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Vc.IsParallelTo.
Extended Type:
|
Full Usage:
Vc.isPerpendicularToUnitVc maxCosine other vector
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
-
Maximum absolute cosine of the angle, exclusive.
other : UnitVc
-
The unit-vector to compare with.
vector : Vc
-
The vector to test.
Returns: bool
TRUE when perpendicular within the tolerance.
Modifiers: inline |
Tests perpendicularity to a unit-vector. Fails for vectors shorter than 1e-12. The instance counterpart is Vc.IsPerpendicularTo.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Vc.rotate r v
Parameters:
Rotation2D
-
The rotation to apply.
v : Vc
-
The 2D vector to rotate.
Returns: Vc
The rotated 2D vector.
Modifiers: inline |
Rotate a 2D vector counter-clockwise by a 2D Rotation (that has cos and sin precomputed).
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Spherically interpolates between start and end by the amount rel. 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 1.0.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Euclid