Logo Euclid

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

this.AngleDiamondInXYTo

Full Usage: this.AngleDiamondInXYTo

Parameters:
Returns: float
Modifiers: inline

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. The static counterpart is UnitVec.angleDiamondInXY.

Extended Type: UnitVec

b : UnitVec
Returns: float

this.AsPnt

Full Usage: this.AsPnt

Parameters:
    () : unit

Returns: Pnt
Modifiers: inline

Convert 3D unit-vector to 3D point.

Extended Type: UnitVec

() : unit
Returns: Pnt

this.AsPt

Full Usage: this.AsPt

Parameters:
    () : unit

Returns: Pt
Modifiers: inline

Convert 3D unit-vector to 2D point, discarding the Z value.

Extended Type: UnitVec

() : unit
Returns: Pt

this.AsUnitVc

Full Usage: this.AsUnitVc

Parameters:
    () : unit

Returns: UnitVc
Modifiers: inline

Convert 3D unit-vector to 2D unit-vector by ignoring Z value and unitizing again. Fails if the projection into the X-Y plane is too short.

Extended Type: UnitVec

() : unit
Returns: UnitVc

this.AsVc

Full Usage: this.AsVc

Parameters:
    () : unit

Returns: Vc
Modifiers: inline

Convert 3D unit-vector to 2D vector, discarding the Z value.

Extended Type: UnitVec

() : unit
Returns: Vc

this.AsVec

Full Usage: this.AsVec

Parameters:
    () : unit

Returns: Vec
Modifiers: inline

Convert 3D unit-vector to 3D vector.

Extended Type: UnitVec

() : unit
Returns: Vec

this.Cross

Full Usage: this.Cross

Parameters:
Returns: Vec
Modifiers: inline

Cross product, of two 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, 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: UnitVec

b : UnitVec
Returns: Vec

this.Cross

Full Usage: this.Cross

Parameters:
Returns: Vec
Modifiers: inline

Cross product, of a 3D unit-vector and a 3D vector. 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: UnitVec

b : Vec
Returns: Vec

this.Direction180InXY

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: UnitVec

() : unit
Returns: float

this.Direction2PiInXY

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: UnitVec

() : unit
Returns: float

this.Direction360InXY

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: UnitVec

() : unit
Returns: float

this.DirectionDiamondInXY

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: UnitVec

() : unit
Returns: float

this.DirectionPiInXY

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: UnitVec

() : unit
Returns: float

this.Dot

Full Usage: this.Dot

Parameters:
Returns: float
Modifiers: inline

Dot product, or scalar product of two 3D unit-vectors. Returns a float. This float of unit-vectors is the Cosine of the angle between the two vectors.

Extended Type: UnitVec

b : UnitVec
Returns: float

this.Dot

Full Usage: this.Dot

Parameters:
Returns: float
Modifiers: inline

Dot product, or scalar product of a 3D unit-vector with a 3D vector. Returns a float. This float is the projected length of the 3D vector on the direction of the unit-vector.

Extended Type: UnitVec

b : Vec
Returns: float

this.DotCosine

Full Usage: this.DotCosine

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: UnitVec

b : UnitVec
Returns: float<MeasureProduct<cosine, MeasureOne>>

this.IsHorizontal

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 the Z-axis is 1e-9 (axisAlignmentTolerance). Fails on vectors shorter than 1e-6.

Extended Type: UnitVec

() : unit
Returns: bool

this.IsOppositeOrientation

Full Usage: this.IsOppositeOrientation

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 3D unit-vectors is more than 90 degrees. Calculates the dot product of two 3D unit-vectors. Then checks if it is smaller than minus 1e-12.

Extended Type: UnitVec

other : UnitVec
Returns: bool

this.IsOppositeOrientation

Full Usage: this.IsOppositeOrientation

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between this 3D unit-vector and a 3D vector is more than 90 degrees. Calculates the dot product of a 3D vector and a unit-vector. Then checks if it is smaller than minus 1e-12.

Extended Type: UnitVec

other : Vec
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
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 minimum cosine value. See Euclid.Cosine module. The static counterpart is UnitVec.areParallelAndOriented.

Extended Type: UnitVec

other : UnitVec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if this 3D unit vector 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 minimum cosine value. See Euclid.Cosine module.

Extended Type: UnitVec

other : Vec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
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 minimum cosine value. See Euclid.Cosine module. The static counterpart is UnitVec.areParallel.

Extended Type: UnitVec

other : UnitVec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if this 3D unit vector 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 minimum cosine value. See Euclid.Cosine module.

Extended Type: UnitVec

other : Vec
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
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 minimum cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. The static counterpart is UnitVec.arePerpendicular.

Extended Type: UnitVec

other : UnitVec
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if this 3D unit vector 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 minimum cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module.

Extended Type: UnitVec

other : Vec
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsVertical

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 the X and Y axes is 1e-9 (axisAlignmentTolerance). Same as v.IsZAligned

Extended Type: UnitVec

() : unit
Returns: bool

this.IsXAligned

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 the Y and Z axes is 1e-9 (axisAlignmentTolerance).

Extended Type: UnitVec

() : unit
Returns: bool

this.IsYAligned

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 the X and Z axes is 1e-9 (axisAlignmentTolerance).

Extended Type: UnitVec

() : unit
Returns: bool

this.IsZAligned

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 the X and Y axes is 1e-9 (axisAlignmentTolerance). Same as v.IsVertical

Extended Type: UnitVec

() : unit
Returns: bool

this.LengthInXY

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: UnitVec

() : unit
Returns: float

this.LengthInXYSq

Full Usage: this.LengthInXYSq

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: UnitVec

() : unit
Returns: float

this.MatchesOrientation

Full Usage: this.MatchesOrientation

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 3D unit-vectors is less than 90 degrees. Calculates the dot product of two 3D unit-vectors. Then checks if it is bigger than 1e-12.

Extended Type: UnitVec

other : UnitVec
Returns: bool

this.MatchesOrientation

Full Usage: this.MatchesOrientation

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the this 3D unit vector and a 3D vector is less than 90 degrees. Calculates the dot product of a 3D vector and a unit-vectors. Then checks if it is bigger than 1e-12.

Extended Type: UnitVec

other : Vec
Returns: bool

this.PerpendicularInXY

Full Usage: this.PerpendicularInXY

Parameters:
    () : unit

Returns: Vec
Modifiers: inline

Returns a perpendicular horizontal vector. Rotated counter-clockwise. Or Vec.Zero if input is vertical. Just does Vec(-v.Y, v.X, 0.0)

Extended Type: UnitVec

() : unit
Returns: Vec

this.Rotate

Full Usage: this.Rotate

Parameters:
Returns: UnitVec The rotated 3D unit-vector.
Modifiers: inline

Rotate the 3D unit-vector by a Quaternion around the Origin.

Extended Type: UnitVec

q : Quaternion

The rotation to apply.

Returns: UnitVec

The rotated 3D unit-vector.

this.Rotate2Dby90CCW

Full Usage: this.Rotate2Dby90CCW

Parameters:
    () : unit

Returns: UnitVec
Modifiers: inline

90-degree rotation counter-clockwise around Z-axis.

Extended Type: UnitVec

() : unit
Returns: UnitVec

this.Rotate2Dby90CW

Full Usage: this.Rotate2Dby90CW

Parameters:
    () : unit

Returns: UnitVec
Modifiers: inline

90-degree rotation clockwise around Z-axis.

Extended Type: UnitVec

() : unit
Returns: UnitVec

this.RotateByQuarterCircle

Full Usage: this.RotateByQuarterCircle

Parameters:
    numberOfQuarters : int

Returns: UnitVec
Modifiers: inline

Rotates the 3D unit-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: UnitVec

numberOfQuarters : int
Returns: UnitVec

this.TransformRigid

Full Usage: this.TransformRigid

Parameters:
Returns: UnitVec
Modifiers: inline

Multiplies (or applies) a RigidMatrix to a 3D unit-vector. Since a 3D vector represents a direction or translation in space, but not a location, all translations are ignored. (Homogeneous Vector)

Extended Type: UnitVec

m : RigidMatrix
Returns: UnitVec

this.WithX

Full Usage: this.WithX

Parameters:
    x : float

Returns: Vec
Modifiers: inline

Returns a new 3D vector with new X coordinate, Y and Z stay the same.

Extended Type: UnitVec

x : float
Returns: Vec

this.WithY

Full Usage: this.WithY

Parameters:
    y : float

Returns: Vec
Modifiers: inline

Returns a new 3D vector with new y coordinate, X and Z stay the same.

Extended Type: UnitVec

y : float
Returns: Vec

this.WithZ

Full Usage: this.WithZ

Parameters:
    z : float

Returns: Vec
Modifiers: inline

Returns a new 3D vector with new z coordinate, X and Y stay the same.

Extended Type: UnitVec

z : float
Returns: Vec

UnitVec.XAxis()

Full Usage: UnitVec.XAxis()

Parameters:
    () : unit

Returns: UnitVec
Modifiers: inline

Returns the World X-axis with length one: UnitVec(1, 0, 0)

Extended Type: UnitVec

() : unit
Returns: UnitVec

UnitVec.YAxis()

Full Usage: UnitVec.YAxis()

Parameters:
    () : unit

Returns: UnitVec
Modifiers: inline

Returns the World Y-axis with length one: UnitVec(0, 1, 0)

Extended Type: UnitVec

() : unit
Returns: UnitVec

UnitVec.ZAxis()

Full Usage: UnitVec.ZAxis()

Parameters:
    () : unit

Returns: UnitVec
Modifiers: inline

Returns the World Z-axis with length one: UnitVec(0, 0, 1)

Extended Type: UnitVec

() : unit
Returns: UnitVec

UnitVec.add a b

Full Usage: UnitVec.add a b

Parameters:
Returns: Vec
Modifiers: inline

Add two 3D unit-vectors together. Returns a new (non-unitized) 3D vector.

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: Vec

UnitVec.addX x v

Full Usage: UnitVec.addX x v

Parameters:
Returns: Vec
Modifiers: inline
Type parameters: ^a (requires (static member op_Addition : Microsoft.FSharp.Core.float * ^a -> Microsoft.FSharp.Core.float))

Adds the given delta to the X component. Returns a new (non-unitized) 3D vector.

Extended Type: UnitVec

x : ^a
v : UnitVec
Returns: Vec

UnitVec.addY y v

Full Usage: UnitVec.addY y v

Parameters:
Returns: Vec
Modifiers: inline
Type parameters: ^a (requires (static member op_Addition : Microsoft.FSharp.Core.float * ^a -> Microsoft.FSharp.Core.float))

Adds the given delta to the Y component. Returns a new (non-unitized) 3D vector.

Extended Type: UnitVec

y : ^a
v : UnitVec
Returns: Vec

UnitVec.addZ z v

Full Usage: UnitVec.addZ z v

Parameters:
Returns: Vec
Modifiers: inline
Type parameters: ^a (requires (static member op_Addition : Microsoft.FSharp.Core.float * ^a -> Microsoft.FSharp.Core.float))

Adds the given delta to the Z component. Returns a new (non-unitized) 3D vector.

Extended Type: UnitVec

z : ^a
v : UnitVec
Returns: Vec

UnitVec.angle180 a b

Full Usage: UnitVec.angle180 a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle between two 3D unit-vectors in degrees. Takes vector orientation into account. Range 0 to 180 degrees.

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: float

UnitVec.angle2PiInXY a b

Full Usage: UnitVec.angle2PiInXY a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle from vector 'a' to vector 'b' projected in X-Y plane. In radians. Considering counter-clockwise rotation round the World Z-axis. Range: 0.0 to 2 Pi ( = 0 to 360 degrees)

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: float

UnitVec.angle360InXY a b

Full Usage: UnitVec.angle360InXY a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle of two 3D unit-vector projected in X-Y plane in degrees. Considering positive rotation round the World Z-axis. Range: 0 to 360 degrees.

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: float

UnitVec.angle90 a b

Full Usage: UnitVec.angle90 a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle between two 3D unit-vectors in degrees, Ignores vector orientation. Range: 0 to 90 degrees.

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: float

UnitVec.angleDiamondInXY a b

Full Usage: UnitVec.angleDiamondInXY a b

Parameters:
Returns: float
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. For World X-Y plane. Considers only the X and Y components of the vector. The instance counterpart is UnitVec.AngleDiamondInXYTo.

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: float

UnitVec.angleHalfPi a b

Full Usage: UnitVec.angleHalfPi a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle between two 3D unit-vectors in radians. Ignores orientation. Range 0.0 to Pi/2 ( = 0 to 90 degrees)

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: float

UnitVec.anglePi a b

Full Usage: UnitVec.anglePi a b

Parameters:
Returns: float
Modifiers: inline

Returns angle between two 3D unit-vectors in radians. Takes vector orientation into account. Range 0.0 to Pi( = 0 to 180 degrees)

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: float

UnitVec.areParallel minCosine a b

Full Usage: UnitVec.areParallel minCosine a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D unit-vectors are parallel. Ignoring orientation. Use a precomputed value from Euclid.Cosine module as tolerance. The instance counterpart is UnitVec.IsParallelTo.

Extended Type: UnitVec

minCosine : float<MeasureProduct<cosine, MeasureOne>>
a : UnitVec
b : UnitVec
Returns: bool

UnitVec.areParallelAndOriented minCosine a b

Full Usage: UnitVec.areParallelAndOriented minCosine a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D unit-vectors are parallel and orientated the same way. Use a precomputed value from Euclid.Cosine module as tolerance. The instance counterpart is UnitVec.IsParallelAndOrientedTo.

Extended Type: UnitVec

minCosine : float<MeasureProduct<cosine, MeasureOne>>
a : UnitVec
b : UnitVec
Returns: bool

UnitVec.arePerpendicular maxCosine a b

Full Usage: UnitVec.arePerpendicular maxCosine a b

Parameters:
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 minimum cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. The instance counterpart is UnitVec.IsPerpendicularTo.

Extended Type: UnitVec

maxCosine : float<MeasureProduct<cosine, MeasureOne>>
a : UnitVec
b : UnitVec
Returns: bool

UnitVec.asPnt v

Full Usage: UnitVec.asPnt v

Parameters:
Returns: Pnt
Modifiers: inline

Convert 3D unit-vector to 3D point.

Extended Type: UnitVec

v : UnitVec
Returns: Pnt

UnitVec.asPt v

Full Usage: UnitVec.asPt v

Parameters:
Returns: Pt
Modifiers: inline

Convert 3D unit-vector to 2D point by ignoring Z value.

Extended Type: UnitVec

v : UnitVec
Returns: Pt

UnitVec.asUnitVc v

Full Usage: UnitVec.asUnitVc v

Parameters:
Returns: UnitVc
Modifiers: inline

Convert 3D unit-vector to 2D unit-vector by ignoring Z value and unitizing again.

Extended Type: UnitVec

v : UnitVec
Returns: UnitVc

UnitVec.asVc v

Full Usage: UnitVec.asVc v

Parameters:
Returns: Vc
Modifiers: inline

Convert 3D unit-vector to 2D vector, discarding the Z value.

Extended Type: UnitVec

v : UnitVec
Returns: Vc

UnitVec.asVec v

Full Usage: UnitVec.asVec v

Parameters:
Returns: Vec
Modifiers: inline

Convert 3D unit-vector to 3D vector.

Extended Type: UnitVec

v : UnitVec
Returns: Vec

UnitVec.createFromMembersXYZ vec

Full Usage: UnitVec.createFromMembersXYZ vec

Parameters:
    vec : ^T

Returns: UnitVec
Modifiers: inline
Type parameters: ^T, ^a, ^b, ^c (requires (member get_X : ^T -> ^a) and (member get_Y : ^T -> ^b) and (member get_Z : ^T -> ^c) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^c -> Microsoft.FSharp.Core.float))

Accepts any type that has an X, Y and Z (UPPERCASE) member that can be converted to a float. Does the unitizing too. Internally this is not using reflection at runtime but F# Statically Resolved Type Parameters at compile time.

Extended Type: UnitVec

vec : ^T
Returns: UnitVec

UnitVec.createFromMembersxyz vec

Full Usage: UnitVec.createFromMembersxyz vec

Parameters:
    vec : ^T

Returns: UnitVec
Modifiers: inline
Type parameters: ^T, ^a, ^b, ^c (requires (member get_x : ^T -> ^a) and (member get_y : ^T -> ^b) and (member get_z : ^T -> ^c) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^c -> Microsoft.FSharp.Core.float))

Accepts any type that has a x, y and z (lowercase) member that can be converted to a float. Does the unitizing too. Internally this is not using reflection at runtime but F# Statically Resolved Type Parameters at compile time.

Extended Type: UnitVec

vec : ^T
Returns: UnitVec

UnitVec.createFromPnt pnt

Full Usage: UnitVec.createFromPnt pnt

Parameters:
Returns: UnitVec
Modifiers: inline

Create 3D unit-vector from 3D point. Does the unitizing too.

Extended Type: UnitVec

pnt : Pnt
Returns: UnitVec

UnitVec.createFromTo fromPnt toPnt

Full Usage: UnitVec.createFromTo fromPnt toPnt

Parameters:
Returns: UnitVec
Modifiers: inline

Create 3D unit-vector from start and endpoint. Does the unitizing too.

Extended Type: UnitVec

fromPnt : Pnt
toPnt : Pnt
Returns: UnitVec

UnitVec.createFromVec v

Full Usage: UnitVec.createFromVec v

Parameters:
Returns: UnitVec
Modifiers: inline

Create 3D unit-vector from 3D vector. Does the unitizing too.

Extended Type: UnitVec

v : Vec
Returns: UnitVec

UnitVec.cross (a, b)

Full Usage: UnitVec.cross (a, b)

Parameters:
Returns: Vec
Modifiers: inline

Cross product, of a 3D unit-vector and a 3D vector. 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: UnitVec

a : UnitVec
b : Vec
Returns: Vec

UnitVec.cross (a, b)

Full Usage: UnitVec.cross (a, b)

Parameters:
Returns: Vec
Modifiers: inline

Cross product, of a 3D vector and a 3D unit-vector. 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: UnitVec

a : Vec
b : UnitVec
Returns: Vec

UnitVec.determinant3 (u, v, w)

Full Usage: UnitVec.determinant3 (u, v, w)

Parameters:
Returns: float
Modifiers: inline

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: UnitVec

u : UnitVec
v : UnitVec
w : UnitVec
Returns: float

UnitVec.difference a b

Full Usage: UnitVec.difference a b

Parameters:
Returns: float
Modifiers: inline

Returns the distance between the tips of two 3D unit-vectors.

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: float

UnitVec.differenceSq a b

Full Usage: UnitVec.differenceSq a b

Parameters:
Returns: float
Modifiers: inline

Returns the squared distance between the tips of two 3D unit-vectors. This operation is slightly faster than Vec.difference and sufficient for many algorithms like finding closest points.

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: float

UnitVec.direction180InXY v

Full Usage: UnitVec.direction180InXY v

Parameters:
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: UnitVec

v : UnitVec
Returns: float

UnitVec.direction2PiInXY v

Full Usage: UnitVec.direction2PiInXY v

Parameters:
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: UnitVec

v : UnitVec
Returns: float

UnitVec.direction360InXY v

Full Usage: UnitVec.direction360InXY v

Parameters:
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: UnitVec

v : UnitVec
Returns: float

UnitVec.directionDiamondInXY v

Full Usage: UnitVec.directionDiamondInXY v

Parameters:
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: UnitVec

v : UnitVec
Returns: float

UnitVec.directionPiInXY v

Full Usage: UnitVec.directionPiInXY v

Parameters:
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: UnitVec

v : UnitVec
Returns: float

UnitVec.dotCosine a b

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: UnitVec

a : UnitVec
b : UnitVec
Returns: float<MeasureProduct<cosine, MeasureOne>>

UnitVec.dotVec a b

Full Usage: UnitVec.dotVec a b

Parameters:
Returns: float
Modifiers: inline

Dot product, or scalar product of a 3D unit-vector with a 3D vector. Returns a float. This float is the projected length of the 3D vector on the direction of the unit-vector.

Extended Type: UnitVec

a : UnitVec
b : Vec
Returns: float

UnitVec.equalsExact a b

Full Usage: UnitVec.equalsExact a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D unit-vectors are exactly equal. Compares each field with the = operator, so a NaN value is never equal.

Extended Type: UnitVec

a : UnitVec
b : UnitVec
Returns: bool

UnitVec.equalsWithin tol a b

Full Usage: UnitVec.equalsWithin tol a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D unit-vectors are equal within tolerance. Identical unit-vectors in opposite directions are not considered equal. The tolerance applies to the X, Y and Z components separately, not to the Euclidean distance between the tips. Use UnitVec.equalsExact to check for an exact match.

Extended Type: UnitVec

tol : float
a : UnitVec
b : UnitVec
Returns: bool

UnitVec.getX v

Full Usage: UnitVec.getX v

Parameters:
Returns: float
Modifiers: inline

Gets the X part of this 3D unit-vector.

Extended Type: UnitVec

v : UnitVec
Returns: float

UnitVec.getY v

Full Usage: UnitVec.getY v

Parameters:
Returns: float
Modifiers: inline

Gets the Y part of this 3D unit-vector.

Extended Type: UnitVec

v : UnitVec
Returns: float

UnitVec.getZ v

Full Usage: UnitVec.getZ v

Parameters:
Returns: float
Modifiers: inline

Gets the Z part of this 3D unit-vector.

Extended Type: UnitVec

v : UnitVec
Returns: float

UnitVec.isHorizontal v

Full Usage: UnitVec.isHorizontal v

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D vector is horizontal (Z component is almost zero). The absolute deviation tolerance along the Z-axis is 1e-9 (axisAlignmentTolerance). Fails on vectors shorter than 1e-6.

Extended Type: UnitVec

v : UnitVec
Returns: bool

UnitVec.isOppositeOrientation other v

Full Usage: UnitVec.isOppositeOrientation other v

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 3D unit-vectors is more than 90 degrees. Calculates the dot product of two 3D unit-vectors. Then checks if it is smaller than minus 1e-12.

Extended Type: UnitVec

other : UnitVec
v : UnitVec
Returns: bool

UnitVec.isVertical v

Full Usage: UnitVec.isVertical v

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D unit-vector is parallel to the world Z-axis. Ignoring orientation. The absolute deviation tolerance along the X and Y axes is 1e-9 (axisAlignmentTolerance). Same as v.IsZAligned

Extended Type: UnitVec

v : UnitVec
Returns: bool

UnitVec.isXAligned v

Full Usage: UnitVec.isXAligned v

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D unit-vector is parallel to the world X-axis. Ignoring orientation. The absolute deviation tolerance along the Y and Z axes is 1e-9 (axisAlignmentTolerance).

Extended Type: UnitVec

v : UnitVec
Returns: bool

UnitVec.isYAligned v

Full Usage: UnitVec.isYAligned v

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D unit-vector is parallel to the world Y-axis. Ignoring orientation. The absolute deviation tolerance along the X and Z axes is 1e-9 (axisAlignmentTolerance).

Extended Type: UnitVec

v : UnitVec
Returns: bool

UnitVec.isZAligned v

Full Usage: UnitVec.isZAligned v

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D unit-vector is parallel to the world Z-axis. Ignoring orientation. The absolute deviation tolerance along the X and Y axes is 1e-9 (axisAlignmentTolerance). Same as v.IsVertical

Extended Type: UnitVec

v : UnitVec
Returns: bool

UnitVec.lengthInXY v

Full Usage: UnitVec.lengthInXY v

Parameters:
Returns: float
Modifiers: inline

Returns the length of the 3D vector projected into World X-Y plane.

Extended Type: UnitVec

v : UnitVec
Returns: float

UnitVec.lengthInXYSq v

Full Usage: UnitVec.lengthInXYSq v

Parameters:
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: UnitVec

v : UnitVec
Returns: float

UnitVec.lerp start endValue rel

Full Usage: UnitVec.lerp start endValue rel

Parameters:
Returns: Vec

Linearly interpolates between two vectors. e.g. rel=0.5 will return the middle vector, rel=1.0 the end vector, rel=1.5 a vector half the distance beyond the end vector.

Extended Type: UnitVec

start : UnitVec
endValue : UnitVec
rel : float
Returns: Vec

UnitVec.matchOrientation orientationToMatch vecToFlip

Full Usage: UnitVec.matchOrientation orientationToMatch vecToFlip

Parameters:
Returns: UnitVec
Modifiers: inline

Ensure that the 3D unit-vector has a positive dot product with given 3D orientation unit-vector.

Extended Type: UnitVec

orientationToMatch : UnitVec
vecToFlip : UnitVec
Returns: UnitVec

UnitVec.matchVecOrientation orientationToMatch vecToFlip

Full Usage: UnitVec.matchVecOrientation orientationToMatch vecToFlip

Parameters:
Returns: UnitVec
Modifiers: inline

Ensure that the 3D unit-vector has a positive dot product with given 3D orientation vector.

Extended Type: UnitVec

orientationToMatch : Vec
vecToFlip : UnitVec
Returns: UnitVec

UnitVec.matchesOrientation other v

Full Usage: UnitVec.matchesOrientation other v

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 3D unit-vectors is less than 90 degrees. Calculates the dot product of two 3D unit-vectors. Then checks if it is bigger than 1e-12.

Extended Type: UnitVec

other : UnitVec
v : UnitVec
Returns: bool

UnitVec.notEqualsWithin tol a b

Full Usage: UnitVec.notEqualsWithin tol a b

Parameters:
Returns: bool

Check if two 3D unit-vectors are not equal within a given tolerance. The tolerance applies to the X, Y and Z components separately, not to the Euclidean distance between the tips.

Extended Type: UnitVec

tol : float
a : UnitVec
b : UnitVec
Returns: bool

UnitVec.orientDown v

Full Usage: UnitVec.orientDown v

Parameters:
Returns: UnitVec
Modifiers: inline

Reverse vector if Z part is bigger than 0.0

Extended Type: UnitVec

v : UnitVec
Returns: UnitVec

UnitVec.orientUp v

Full Usage: UnitVec.orientUp v

Parameters:
Returns: UnitVec
Modifiers: inline

Reverse vector if Z part is smaller than 0.0

Extended Type: UnitVec

v : UnitVec
Returns: UnitVec

UnitVec.perpendicularInVerticalPlane v

Full Usage: UnitVec.perpendicularInVerticalPlane v

Parameters:
Returns: Vec
Modifiers: inline

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 is of zero length.

Extended Type: UnitVec

v : UnitVec
Returns: Vec

UnitVec.perpendicularInXY v

Full Usage: UnitVec.perpendicularInXY v

Parameters:
Returns: Vec
Modifiers: inline

Returns a perpendicular horizontal vector. Rotated counter-clockwise. Or Vec.Zero if input is vertical. Just does Vec(-v.Y, v.X, 0.0)

Extended Type: UnitVec

v : UnitVec
Returns: Vec

UnitVec.projectToXYPlane v

Full Usage: UnitVec.projectToXYPlane v

Parameters:
Returns: Vec
Modifiers: inline

Project vector to World X-Y plane. Use UnitVec.asVc to convert to a 2D vector instance.

Extended Type: UnitVec

v : UnitVec
Returns: Vec

UnitVec.reverse v

Full Usage: UnitVec.reverse v

Parameters:
Returns: UnitVec
Modifiers: inline

Negate or inverse a 3D unit-vector. Returns a new 3D unit-vector.

Extended Type: UnitVec

v : UnitVec
Returns: UnitVec

UnitVec.rotate q uVec

Full Usage: UnitVec.rotate q uVec

Parameters:
Returns: UnitVec
Modifiers: inline

Rotate the 3D unit-vector by Quaternion around the Origin

Extended Type: UnitVec

q : Quaternion
uVec : UnitVec
Returns: UnitVec

UnitVec.rotate2Dby90CCW v

Full Usage: UnitVec.rotate2Dby90CCW v

Parameters:
Returns: UnitVec
Modifiers: inline

90-degree rotation counter-clockwise around Z-axis.

Extended Type: UnitVec

v : UnitVec
Returns: UnitVec

UnitVec.rotate2Dby90CW v

Full Usage: UnitVec.rotate2Dby90CW v

Parameters:
Returns: UnitVec
Modifiers: inline

90-degree rotation clockwise around Z-axis.

Extended Type: UnitVec

v : UnitVec
Returns: UnitVec

UnitVec.rotateByQuarterCircle numberOfQuarters v

Full Usage: UnitVec.rotateByQuarterCircle numberOfQuarters v

Parameters:
    numberOfQuarters : int
    v : UnitVec

Returns: UnitVec

Rotates a 3D unit-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: UnitVec

numberOfQuarters : int
v : UnitVec
Returns: UnitVec

UnitVec.rotateOnX r v

Full Usage: UnitVec.rotateOnX r v

Parameters:
Returns: UnitVec
Modifiers: inline

Rotate the 3D unit-vector around X-axis, from Y to Z-axis, counter-clockwise looking from right.

Extended Type: UnitVec

r : Rotation2D
v : UnitVec
Returns: UnitVec

UnitVec.rotateOnXDegrees angDegree v

Full Usage: UnitVec.rotateOnXDegrees angDegree v

Parameters:
Returns: UnitVec
Modifiers: inline

Rotate the 3D unit-vector in degrees around X-axis, from Y to Z-axis, counter-clockwise looking from right.

Extended Type: UnitVec

angDegree : float
v : UnitVec
Returns: UnitVec

UnitVec.rotateOnY r v

Full Usage: UnitVec.rotateOnY r v

Parameters:
Returns: UnitVec
Modifiers: inline

Rotate the 3D unit-vector around Y-axis, from Z to X-axis, counter-clockwise looking from back.

Extended Type: UnitVec

r : Rotation2D
v : UnitVec
Returns: UnitVec

UnitVec.rotateOnYDegrees angDegree v

Full Usage: UnitVec.rotateOnYDegrees angDegree v

Parameters:
Returns: UnitVec
Modifiers: inline

Rotate the 3D unit-vector in degrees around Y-axis, from Z to X-axis, counter-clockwise looking from back.

Extended Type: UnitVec

angDegree : float
v : UnitVec
Returns: UnitVec

UnitVec.rotateOnZ r v

Full Usage: UnitVec.rotateOnZ r v

Parameters:
Returns: UnitVec
Modifiers: inline

Rotate the 3D unit-vector around Z-axis, from X to Y-axis, counter-clockwise looking from top.

Extended Type: UnitVec

r : Rotation2D
v : UnitVec
Returns: UnitVec

UnitVec.rotateOnZDegrees angDegree v

Full Usage: UnitVec.rotateOnZDegrees angDegree v

Parameters:
Returns: UnitVec
Modifiers: inline

Rotate the 3D unit-vector in degrees around Z-axis, from X to Y-axis, counter-clockwise looking from top.

Extended Type: UnitVec

angDegree : float
v : UnitVec
Returns: UnitVec

UnitVec.scale f v

Full Usage: UnitVec.scale f v

Parameters:
Returns: Vec
Modifiers: inline

Multiplies a 3D unit-vector with a scalar, also called scaling a vector. Returns a new (non-unitized) 3D vector.

Extended Type: UnitVec

f : float
v : UnitVec
Returns: Vec

UnitVec.sine a b

Full Usage: UnitVec.sine a b

Parameters:
    a : UnitVec - The first unit-vector.
    b : UnitVec - The second unit-vector.

Returns: float The sine of the unsigned angle.
Modifiers: inline

Sine of the unsigned angle in [0, pi] between two 3D unit-vectors. Unlike the signed 2D sine, this cross-product magnitude is always nonnegative.

Extended Type: UnitVec

a : UnitVec

The first unit-vector.

b : UnitVec

The second unit-vector.

Returns: float

The sine of the unsigned angle.

UnitVec.slerp start endValue rel

Full Usage: UnitVec.slerp start endValue rel

Parameters:
Returns: UnitVec

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 1.0.

Extended Type: UnitVec

start : UnitVec
endValue : UnitVec
rel : float
Returns: UnitVec

UnitVec.slopeDegrees v

Full Usage: UnitVec.slopeDegrees v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative slope of a 3D unit-vector in degrees. This is the elevation angle from the World X-Y plane (not from the X-axis). Range -90 to +90 degrees.

Extended Type: UnitVec

v : UnitVec
Returns: float

UnitVec.slopePercent v

Full Usage: UnitVec.slopePercent v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative slope of a 3D unit-vector in Percent. This is the elevation angle from the World X-Y plane (not from the X-axis). 100% = 45 degrees. Returns positive (or negative) infinity if line is vertical.

Extended Type: UnitVec

v : UnitVec
Returns: float

UnitVec.slopeRadians v

Full Usage: UnitVec.slopeRadians v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative slope of a 3D unit-vector in radians. This is the elevation angle from the World X-Y plane (not from the X-axis). Range -1.57 to +1.57 radians.

Extended Type: UnitVec

v : UnitVec
Returns: float

UnitVec.tangent a b

Full Usage: UnitVec.tangent a b

Parameters:
    a : UnitVec - The first unit-vector.
    b : UnitVec - The second unit-vector.

Returns: float The cross-product magnitude divided by the dot product.
Modifiers: inline

Tangent of the unsigned angle in [0, pi] between two 3D unit-vectors. Positive for acute and negative for obtuse angles; no clockwise/counter-clockwise sign exists in 3D. Returns Infinity at perpendicularity, matching UnitVc.tangent's floating-point division contract.

Extended Type: UnitVec

a : UnitVec

The first unit-vector.

b : UnitVec

The second unit-vector.

Returns: float

The cross-product magnitude divided by the dot product.

UnitVec.transformRigid m v

Full Usage: UnitVec.transformRigid m v

Parameters:
Returns: UnitVec
Modifiers: inline

Multiplies (or applies) a RigidMatrix to a 3D unit-vector. Since a 3D vector represents a direction or translation in space, but not a location, all translations are ignored. (Homogeneous Vector) The resulting vector is unitized too.

Extended Type: UnitVec

m : RigidMatrix
v : UnitVec
Returns: UnitVec

UnitVec.withX x v

Full Usage: UnitVec.withX x v

Parameters:
Returns: Vec
Modifiers: inline

Returns a new 3D vector with new X coordinate, Y and Z stay the same.

Extended Type: UnitVec

x : float
v : UnitVec
Returns: Vec

UnitVec.withY y v

Full Usage: UnitVec.withY y v

Parameters:
Returns: Vec
Modifiers: inline

Returns a new 3D vector with new y coordinate, X and Z stay the same.

Extended Type: UnitVec

y : float
v : UnitVec
Returns: Vec

UnitVec.withZ z v

Full Usage: UnitVec.withZ z v

Parameters:
Returns: Vec
Modifiers: inline

Returns a new 3D vector with new z coordinate, X and Y stay the same.

Extended Type: UnitVec

z : float
v : UnitVec
Returns: Vec

Type something to start searching.