Header menu logo Euclid

AutoOpenUnitVc Module

When Euclid is opened this module will be auto-opened. It only contains extension members for type UnitVc.

Type extensions

Type extension Description

this.AngleDiamondTo

Full Usage: this.AngleDiamondTo

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.

Extended Type: UnitVc

b : UnitVc
Returns: float

this.AsPnt

Full Usage: this.AsPnt

Parameters:
    () : unit

Returns: Pnt
Modifiers: inline

Convert 2D unit-vector to 3D point using 0.0 as Z value.

Extended Type: UnitVc

() : unit
Returns: Pnt

this.AsPnt

Full Usage: this.AsPnt

Returns: Pnt
Modifiers: inline

Convert 2D unit-vector to 3D point using 0.0 as Z value.

Extended Type: UnitVc

Returns: Pnt

this.AsPt

Full Usage: this.AsPt

Parameters:
    () : unit

Returns: Pt
Modifiers: inline

Convert 2D unit-vector to 2D point.

Extended Type: UnitVc

() : unit
Returns: Pt

this.AsPt

Full Usage: this.AsPt

Returns: Pt
Modifiers: inline

Convert 2D unit-vector to 2D point.

Extended Type: UnitVc

Returns: Pt

this.AsUnitVec

Full Usage: this.AsUnitVec

Parameters:
    () : unit

Returns: UnitVec
Modifiers: inline

Convert 2D unit-vector to 3D unit-vector using 0.0 as Z value. If you want a different Z value use the member v.WithZ(z)

Extended Type: UnitVc

() : unit
Returns: UnitVec

this.AsUnitVec

Full Usage: this.AsUnitVec

Returns: UnitVec
Modifiers: inline

Convert 2D unit-vector to 3D unit-vector using 0.0 as Z value. If you want a different Z value use the member v.WithZ(z)

Extended Type: UnitVc

Returns: UnitVec

this.AsVc

Full Usage: this.AsVc

Parameters:
    () : unit

Returns: Vc
Modifiers: inline

Convert 2D unit-vector to 2D vector

Extended Type: UnitVc

() : unit
Returns: Vc

this.AsVc

Full Usage: this.AsVc

Returns: Vc
Modifiers: inline

Convert 2D unit-vector to 2D vector

Extended Type: UnitVc

Returns: Vc

this.AsVec

Full Usage: this.AsVec

Parameters:
    () : unit

Returns: Vec
Modifiers: inline

Convert 2D unit-vector to 3D vector using 0.0 as Z value. If you want a different Z value use the member v.WithZ(z)

Extended Type: UnitVc

() : unit
Returns: Vec

this.AsVec

Full Usage: this.AsVec

Returns: Vec
Modifiers: inline

Convert 2D unit-vector to 3D vector using 0.0 as Z value. If you want a different Z value use the member v.WithZ(z)

Extended Type: UnitVc

Returns: Vec

this.Cross

Full Usage: this.Cross

Parameters:
Returns: float
Modifiers: inline

The 2D Cross Product of a 2D unit-vector with a 2D vector. 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: UnitVc

b : Vc
Returns: float

this.Cross

Full Usage: this.Cross

Parameters:
Returns: float
Modifiers: inline

The 2D Cross Product of two 2D unit-vectors. 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: UnitVc

b : UnitVc
Returns: float

this.Direction180

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

() : unit
Returns: float

this.Direction180

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

Returns: float

this.Direction2Pi

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

() : unit
Returns: float

this.Direction2Pi

Full Usage: this.Direction2Pi

Returns: float
Modifiers: inline

Returns the angle in Radians from X-axis, Going Counter-Clockwise till two Pi.

Extended Type: UnitVc

Returns: float

this.Direction360

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

() : unit
Returns: float

this.Direction360

Full Usage: this.Direction360

Returns: float
Modifiers: inline

Returns the angle in Degrees from X-axis. Going Counter-Clockwise till 360.

Extended Type: UnitVc

Returns: float

this.DirectionDiamond

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

() : unit
Returns: float

this.DirectionDiamond

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

Returns: float

this.DirectionPi

Full Usage: this.DirectionPi

Parameters:
    () : unit

Returns: float
Modifiers: inline

Returns the angle in Radians from X-axis, Ignores orientation. Range 0.0 to Pi.

Extended Type: UnitVc

() : unit
Returns: float

this.DirectionPi

Full Usage: this.DirectionPi

Returns: float
Modifiers: inline

Returns the angle in Radians from X-axis, Ignores orientation. Range 0.0 to Pi.

Extended Type: UnitVc

Returns: float

this.Dot

Full Usage: this.Dot

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: UnitVc

b : UnitVc
Returns: float

this.Dot

Full Usage: this.Dot

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: UnitVc

b : Vc
Returns: float

this.DotCosine

Full Usage: this.DotCosine

Parameters:
Returns: float<MeasureProduct<cosine, MeasureOne>>
Modifiers: inline

Dot product, or scalar product of two 2D unit-vectors. 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: UnitVc

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

this.IsOppositeOrientation

Full Usage: this.IsOppositeOrientation

Parameters:
Returns: bool
Modifiers: inline

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

Extended Type: UnitVc

other : UnitVc
Returns: bool

this.IsOppositeOrientation

Full Usage: this.IsOppositeOrientation

Parameters:
    other : Vc

Returns: bool
Modifiers: inline

Checks if the angle between the this 2D unit-vectors and a 2D 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.

Extended Type: UnitVc

other : Vc
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D 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: UnitVc

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

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if this 2D unit-vectors and a 2D 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: UnitVc

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

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D 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: UnitVc

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

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if this 2D unit-vectors and a 2D 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: UnitVc

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

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D 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: UnitVc

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

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if this 2D unit-vectors and a 2D 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: UnitVc

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

this.IsXAligned

Full Usage: this.IsXAligned

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 2D unit-vector is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y axis is 1e-9.

Extended Type: UnitVc

() : unit
Returns: bool

this.IsXAligned

Full Usage: this.IsXAligned

Returns: bool
Modifiers: inline

Checks if 2D unit-vector is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y axis is 1e-9.

Extended Type: UnitVc

Returns: bool

this.IsYAligned

Full Usage: this.IsYAligned

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 2D unit-vector is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X axis is 1e-9.

Extended Type: UnitVc

() : unit
Returns: bool

this.IsYAligned

Full Usage: this.IsYAligned

Returns: bool
Modifiers: inline

Checks if 2D unit-vector is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X axis is 1e-9.

Extended Type: UnitVc

Returns: bool

this.MatchesOrientation

Full Usage: this.MatchesOrientation

Parameters:
Returns: bool
Modifiers: inline

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

Extended Type: UnitVc

other : UnitVc
Returns: bool

this.MatchesOrientation

Full Usage: this.MatchesOrientation

Parameters:
    other : Vc

Returns: bool
Modifiers: inline

Checks if the angle between the this 2D unit-vectors and a 2D 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.

Extended Type: UnitVc

other : Vc
Returns: bool

this.Rotate

Full Usage: this.Rotate

Parameters:
    angDegree : float

Returns: UnitVc
Modifiers: inline

Rotate the 2D unit-vector in Degrees. Counter Clockwise. For better Performance recompute the Rotate2D struct and use its member to rotate. see UnitVc.RotateBy.

Extended Type: UnitVc

angDegree : float
Returns: UnitVc

this.Rotate90CCW

Full Usage: this.Rotate90CCW

Parameters:
    () : unit

Returns: UnitVc
Modifiers: inline

90 Degree rotation Counter-Clockwise.

Extended Type: UnitVc

() : unit
Returns: UnitVc

this.Rotate90CCW

Full Usage: this.Rotate90CCW

Returns: UnitVc
Modifiers: inline

90 Degree rotation Counter-Clockwise.

Extended Type: UnitVc

Returns: UnitVc

this.Rotate90CW

Full Usage: this.Rotate90CW

Parameters:
    () : unit

Returns: UnitVc
Modifiers: inline

90 Degree rotation clockwise.

Extended Type: UnitVc

() : unit
Returns: UnitVc

this.Rotate90CW

Full Usage: this.Rotate90CW

Returns: UnitVc
Modifiers: inline

90 Degree rotation clockwise.

Extended Type: UnitVc

Returns: UnitVc

this.RotateBy

Full Usage: this.RotateBy

Parameters:
Returns: UnitVc
Modifiers: inline

Rotate the a 2D unit-vector Counter Clockwise by a 2D Rotation (that has cos and sin precomputed)

Extended Type: UnitVc

r : Rotation2D
Returns: UnitVc

this.WithX

Full Usage: this.WithX

Parameters:
    x : float

Returns: Vc
Modifiers: inline

Returns new 2D vector with new X coordinate, Y stays the same.

Extended Type: UnitVc

x : float
Returns: Vc

this.WithY

Full Usage: this.WithY

Parameters:
    y : float

Returns: Vc
Modifiers: inline

Returns new 2D vector with new Y coordinate, X stays the same.

Extended Type: UnitVc

y : float
Returns: Vc

this.WithZ

Full Usage: this.WithZ

Parameters:
    z : float

Returns: Vec
Modifiers: inline

Returns new 3D vector with Z coordinate, X and Y stay the same. If you want Z to be 0.0 you can use v.AsVec or v.AsUnitVec too.

Extended Type: UnitVc

z : float
Returns: Vec

UnitVc.Xaxis()

Full Usage: UnitVc.Xaxis()

Parameters:
    () : unit

Returns: UnitVc
Modifiers: inline

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

Extended Type: UnitVc

() : unit
Returns: UnitVc

UnitVc.Xaxis

Full Usage: UnitVc.Xaxis

Returns: UnitVc
Modifiers: inline

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

Extended Type: UnitVc

Returns: UnitVc

UnitVc.Yaxis()

Full Usage: UnitVc.Yaxis()

Parameters:
    () : unit

Returns: UnitVc
Modifiers: inline

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

Extended Type: UnitVc

() : unit
Returns: UnitVc

UnitVc.Yaxis

Full Usage: UnitVc.Yaxis

Returns: UnitVc
Modifiers: inline

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

Extended Type: UnitVc

Returns: UnitVc

UnitVc.add a b

Full Usage: UnitVc.add a b

Parameters:
Returns: Vc
Modifiers: inline

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

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: Vc

UnitVc.angle180 a b

Full Usage: UnitVc.angle180 a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle between two 2D unit-vectors in Degrees. Takes vector orientation into account. Ignores order of input vectors. angle180(a, b) = angle180(b, a) Range 0 to 180 Degrees.

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: float

UnitVc.angle2Pi (a, b)

Full Usage: UnitVc.angle2Pi (a, b)

Parameters:
Returns: float
Modifiers: inline

Returns positive angle for rotating Counter-Clockwise from vector 'a' to vector 'b'. In Radians. Range: 0.0 to 2 Pi ( = 360 Degrees)

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: float

UnitVc.angle360 (a, b)

Full Usage: UnitVc.angle360 (a, b)

Parameters:
Returns: float
Modifiers: inline

Returns positive angle for rotating Counter-Clockwise from vector 'a' to vector 'b'. In Degrees. Range: 0 to 360 Degrees

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: float

UnitVc.angle90 a b

Full Usage: UnitVc.angle90 a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle between two 2D unit-vectors in Degrees, Ignores vector orientation. Ignores order of input vectors. angle90(a, b) = angle90(b, a) = angle90(-b, a) = angle90(-b, -a) Range: 0 to 90 Degrees.

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: float

UnitVc.angleDiamond (a, b)

Full Usage: UnitVc.angleDiamond (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.

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: float

UnitVc.angleHalfPi a b

Full Usage: UnitVc.angleHalfPi a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle between two 2D unit-vectors in Radians. Ignores orientation. Ignores order of input vectors. angleHalfPi(a, b) = angleHalfPi(b, a) = angleHalfPi(-b, a) = angleHalfPi(-b, -a) Range 0.0 to Pi/2 ( = 90 Degree)

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: float

UnitVc.anglePi a b

Full Usage: UnitVc.anglePi a b

Parameters:
Returns: float
Modifiers: inline

Returns angle between two 2D unit-vectors in Radians. Takes vector orientation into account. Ignores order of input vectors. anglePi(a, b) = anglePi(b, a) Range 0.0 to Pi( = 180 Degree)

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: float

UnitVc.angleToX180 v

Full Usage: UnitVc.angleToX180 v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative angle of a vector in Degrees from the X-axis. Range -180 to +180 Degrees. This is just atan2(v.Y, v.X) to degrees.

Extended Type: UnitVc

v : UnitVc
Returns: float

UnitVc.angleToXPi v

Full Usage: UnitVc.angleToXPi v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative angle of a vector in Radians from the X-axis. Range -3.14 to +3.14 Radians. This is just atan2(v.Y, v.X).

Extended Type: UnitVc

v : UnitVc
Returns: float

UnitVc.areParallel other v

Full Usage: UnitVc.areParallel other v

Parameters:
Returns: bool
Modifiers: inline

Checks if Angle between two vectors is Below 0.25 Degree. Ignores vector orientation. Same as isAngleBelowQuatreDegree.

Extended Type: UnitVc

other : UnitVc
v : UnitVc
Returns: bool

UnitVc.areParallelAndMatchOrientation other v

Full Usage: UnitVc.areParallelAndMatchOrientation other v

Parameters:
Returns: bool
Modifiers: inline

Checks if Angle between two vectors is between 98.75 and 90.25 Degree. Ignores vector orientation.

Extended Type: UnitVc

other : UnitVc
v : UnitVc
Returns: bool

UnitVc.arePerpendicular other v

Full Usage: UnitVc.arePerpendicular other v

Parameters:
Returns: bool
Modifiers: inline

Checks if Angle between two vectors is between 98.75 and 90.25 Degree. Ignores vector orientation.

Extended Type: UnitVc

other : UnitVc
v : UnitVc
Returns: bool

UnitVc.asPnt v

Full Usage: UnitVc.asPnt v

Parameters:
Returns: Pnt
Modifiers: inline

Convert 2D unit-vector to 2D point using 0.0 as Z value.

Extended Type: UnitVc

v : UnitVc
Returns: Pnt

UnitVc.asPt v

Full Usage: UnitVc.asPt v

Parameters:
Returns: Pt
Modifiers: inline

Convert 2D unit-vector to 2D point.

Extended Type: UnitVc

v : UnitVc
Returns: Pt

UnitVc.asUnitVec v

Full Usage: UnitVc.asUnitVec v

Parameters:
Returns: UnitVec
Modifiers: inline

Convert 2D unit-vector to 2D unit-vector using 0.0 as Z value.

Extended Type: UnitVc

v : UnitVc
Returns: UnitVec

UnitVc.asVec v

Full Usage: UnitVc.asVec v

Parameters:
Returns: Vec
Modifiers: inline

Convert 2D unit-vector to 2D vector using 0.0 as Z value. If you want a different Z value use the member w.WithZ(z)

Extended Type: UnitVc

v : UnitVc
Returns: Vec

UnitVc.create (fromPt, toPt)

Full Usage: UnitVc.create (fromPt, toPt)

Parameters:
    fromPt : Pt
    toPt : Pt

Returns: UnitVc
Modifiers: inline

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

Extended Type: UnitVc

fromPt : Pt
toPt : Pt
Returns: UnitVc

UnitVc.createFromMembersXY vec

Full Usage: UnitVc.createFromMembersXY vec

Parameters:
    vec : ^T

Returns: UnitVc
Modifiers: inline
Type parameters: ^T, ^a, ^b

Accepts any type that has a X and Y (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: UnitVc

vec : ^T
Returns: UnitVc

UnitVc.createFromMembersxy vec

Full Usage: UnitVc.createFromMembersxy vec

Parameters:
    vec : ^T

Returns: UnitVc
Modifiers: inline
Type parameters: ^T, ^a, ^b

Accepts any type that has a x and y (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: UnitVc

vec : ^T
Returns: UnitVc

UnitVc.createFromPt pt

Full Usage: UnitVc.createFromPt pt

Parameters:
Returns: UnitVc
Modifiers: inline

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

Extended Type: UnitVc

pt : Pt
Returns: UnitVc

UnitVc.createFromVec v

Full Usage: UnitVc.createFromVec v

Parameters:
Returns: UnitVc
Modifiers: inline

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

Extended Type: UnitVc

v : Vc
Returns: UnitVc

UnitVc.cross (a, b)

Full Usage: UnitVc.cross (a, b)

Parameters:
Returns: float
Modifiers: inline

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

a : UnitVc
b : Vc
Returns: float

UnitVc.cross (a, b)

Full Usage: UnitVc.cross (a, b)

Parameters:
Returns: float
Modifiers: inline

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

a : Vc
b : UnitVc
Returns: float

UnitVc.difference a b

Full Usage: UnitVc.difference a b

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: float

UnitVc.differenceSq a b

Full Usage: UnitVc.differenceSq a b

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: UnitVc

a : UnitVc
b : UnitVc
Returns: float

UnitVc.direction2Pi v

Full Usage: UnitVc.direction2Pi v

Parameters:
Returns: float
Modifiers: inline

Returns positive angle of unit-vector. Counter-Clockwise from X-axis. In Radians. Range: 0.0 to 2 Pi ( = 360 Degrees)

Extended Type: UnitVc

v : UnitVc
Returns: float

UnitVc.direction360 v

Full Usage: UnitVc.direction360 v

Parameters:
Returns: float
Modifiers: inline

Returns positive angle of unit-vector. Counter-Clockwise from X-axis. In Degrees. Range: 0 to 360 Degrees

Extended Type: UnitVc

v : UnitVc
Returns: float

UnitVc.directionDiamond a

Full Usage: UnitVc.directionDiamond a

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

a : UnitVc
Returns: float

UnitVc.dot (a, b)

Full Usage: UnitVc.dot (a, b)

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: UnitVc

a : UnitVc
b : Vc
Returns: float

UnitVc.dot (a, b)

Full Usage: UnitVc.dot (a, b)

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: UnitVc

a : Vc
b : UnitVc
Returns: float

UnitVc.dotCosine a b

Full Usage: UnitVc.dotCosine a b

Parameters:
Returns: float<MeasureProduct<cosine, MeasureOne>>
Modifiers: inline

Dot product, or scalar product of two 2D 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: UnitVc

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

UnitVc.equals tol a b

Full Usage: UnitVc.equals tol a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D unit-vectors are equal within tolerance. Identical unit-vectors in opposite directions are not considered equal. Use a tolerance of 0.0 to check for an exact match.

Extended Type: UnitVc

tol : float
a : UnitVc
b : UnitVc
Returns: bool

UnitVc.flip v

Full Usage: UnitVc.flip v

Parameters:
Returns: UnitVc
Modifiers: inline

Negate or inverse a 2D unit-vectors. Returns a new 2D unit-vector. Same as UnitVc.reverse.

Extended Type: UnitVc

v : UnitVc
Returns: UnitVc

UnitVc.getX v

Full Usage: UnitVc.getX v

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: UnitVc

v : UnitVc
Returns: float

UnitVc.getY v

Full Usage: UnitVc.getY v

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: UnitVc

v : UnitVc
Returns: float

UnitVc.intersection (ptA, ptB, vA, vB, relAngleDiscriminant)

Full Usage: UnitVc.intersection (ptA, ptB, vA, vB, relAngleDiscriminant)

Parameters:
    ptA : Pt - The start point of the first line.
    ptB : Pt - The start point of the second line.
    vA : UnitVc - The unit-vector of the first line.
    vB : UnitVc - 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. 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: UnitVc

ptA : Pt

The start point of the first line.

ptB : Pt

The start point of the second line.

vA : UnitVc

The unit-vector of the first line.

vB : UnitVc

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

UnitVc.isAngle180Above cosineValue a b

Full Usage: UnitVc.isAngle180Above cosineValue a b

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

cosineValue : float<MeasureProduct<cosine, MeasureOne>>
a : UnitVc
b : UnitVc
Returns: bool

UnitVc.isAngle180Below cosineValue a b

Full Usage: UnitVc.isAngle180Below cosineValue a b

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

cosineValue : float<MeasureProduct<cosine, MeasureOne>>
a : UnitVc
b : UnitVc
Returns: bool

UnitVc.isAngle90Above cosineValue a b

Full Usage: UnitVc.isAngle90Above cosineValue a b

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

cosineValue : float<MeasureProduct<cosine, MeasureOne>>
a : UnitVc
b : UnitVc
Returns: bool

UnitVc.isAngle90Below cosineValue a b

Full Usage: UnitVc.isAngle90Below cosineValue a b

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

cosineValue : float<MeasureProduct<cosine, MeasureOne>>
a : UnitVc
b : UnitVc
Returns: bool

UnitVc.isOppositeOrientation other v

Full Usage: UnitVc.isOppositeOrientation other v

Parameters:
Returns: bool
Modifiers: inline

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

Extended Type: UnitVc

other : UnitVc
v : UnitVc
Returns: bool

UnitVc.isXAligned v

Full Usage: UnitVc.isXAligned v

Parameters:
Returns: bool
Modifiers: inline

Tolerance is 1e-6.

Extended Type: UnitVc

v : UnitVc
Returns: bool

UnitVc.isYAligned v

Full Usage: UnitVc.isYAligned v

Parameters:
Returns: bool
Modifiers: inline

Checks if 2D unit-vector is parallel to the world Y axis. Ignoring orientation. Tolerance is 1e-6.

Extended Type: UnitVc

v : UnitVc
Returns: bool

UnitVc.lerp (start, ende, rel)

Full Usage: UnitVc.lerp (start, ende, rel)

Parameters:
Returns: Vc

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

start : UnitVc
ende : UnitVc
rel : float
Returns: Vc

UnitVc.matchOrientation orientationToMatch vecToFlip

Full Usage: UnitVc.matchOrientation orientationToMatch vecToFlip

Parameters:
Returns: UnitVc
Modifiers: inline

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

Extended Type: UnitVc

orientationToMatch : UnitVc
vecToFlip : UnitVc
Returns: UnitVc

UnitVc.matchVcOrientation orientationToMatch vecToFlip

Full Usage: UnitVc.matchVcOrientation orientationToMatch vecToFlip

Parameters:
    orientationToMatch : Vc
    vecToFlip : UnitVc

Returns: UnitVc
Modifiers: inline

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

Extended Type: UnitVc

orientationToMatch : Vc
vecToFlip : UnitVc
Returns: UnitVc

UnitVc.matchesOrientation other v

Full Usage: UnitVc.matchesOrientation other v

Parameters:
Returns: bool
Modifiers: inline

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

Extended Type: UnitVc

other : UnitVc
v : UnitVc
Returns: bool

UnitVc.moveX x v

Full Usage: UnitVc.moveX x v

Parameters:
Returns: Vc
Modifiers: inline

Add to the X part of this 2D unit-vectors together. Returns a new (non-unitized) 2D vector.

Extended Type: UnitVc

x : float
v : UnitVc
Returns: Vc

UnitVc.moveY y v

Full Usage: UnitVc.moveY y v

Parameters:
Returns: Vc
Modifiers: inline

Add to the Y part of this 2D unit-vectors together. Returns a new (non-unitized) 2D vector.

Extended Type: UnitVc

y : float
v : UnitVc
Returns: Vc

UnitVc.notEquals tol a b

Full Usage: UnitVc.notEquals tol a b

Parameters:
Returns: bool

Check if two 2d unit vectors are not equal within a given tolerance. Use a tolerance of 0.0 to check if the two unit vectors are not exactly equal.

Extended Type: UnitVc

tol : float
a : UnitVc
b : UnitVc
Returns: bool

UnitVc.reverse v

Full Usage: UnitVc.reverse v

Parameters:
Returns: UnitVc
Modifiers: inline

Negate or inverse a 2D unit-vectors. Returns a new 2D unit-vector. Same as UnitVc.flip.

Extended Type: UnitVc

v : UnitVc
Returns: UnitVc

UnitVc.rotate angDegree vec

Full Usage: UnitVc.rotate angDegree vec

Parameters:
    angDegree : float
    vec : UnitVc

Returns: UnitVc
Modifiers: inline

Rotate the 2D unit-vector in Degrees. Counter Clockwise. For better Performance recompute the Rotate2D struct and use its member to rotate. see UnitVc.rotateBy.

Extended Type: UnitVc

angDegree : float
vec : UnitVc
Returns: UnitVc

UnitVc.rotate90CCW v

Full Usage: UnitVc.rotate90CCW v

Parameters:
Returns: UnitVc
Modifiers: inline

90 Degree rotation Counter-Clockwise.

Extended Type: UnitVc

v : UnitVc
Returns: UnitVc

UnitVc.rotate90CW v

Full Usage: UnitVc.rotate90CW v

Parameters:
Returns: UnitVc
Modifiers: inline

90 Degree rotation clockwise.

Extended Type: UnitVc

v : UnitVc
Returns: UnitVc

UnitVc.rotateBy r v

Full Usage: UnitVc.rotateBy r v

Parameters:
Returns: UnitVc
Modifiers: inline

Rotate the a 2D unit-vector Counter Clockwise by a 2D Rotation (that has cos and sin precomputed)

Extended Type: UnitVc

r : Rotation2D
v : UnitVc
Returns: UnitVc

UnitVc.rotateByQuarterCircle numberOfQuarters v

Full Usage: UnitVc.rotateByQuarterCircle numberOfQuarters v

Parameters:
    numberOfQuarters : int
    v : UnitVc

Returns: UnitVc

Rotates a vector 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: UnitVc

numberOfQuarters : int
v : UnitVc
Returns: UnitVc

UnitVc.scale scale v

Full Usage: UnitVc.scale scale v

Parameters:
Returns: Vc
Modifiers: inline

Multiplies a 2D unit-vector with a scalar, also called scaling a vector. Same as UnitVc.withLength. Returns a new (non-unitized) 2D vector.

Extended Type: UnitVc

scale : float
v : UnitVc
Returns: Vc

UnitVc.slerp (start, ende, rel)

Full Usage: UnitVc.slerp (start, ende, rel)

Parameters:
Returns: UnitVc

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

start : UnitVc
ende : UnitVc
rel : float
Returns: UnitVc

UnitVc.slopeDegree v

Full Usage: UnitVc.slopeDegree v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative slope of a 2D unit-vector in Degrees. This is the same as the positive or negative angle to the X-axis(or its reverse). Range -90 to +90 Degrees. This is just asin(v.Y).

Extended Type: UnitVc

v : UnitVc
Returns: float

UnitVc.slopePercent v

Full Usage: UnitVc.slopePercent v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative slope of a 2D unit-vector in Percent to the X-axis(or its reverse). 100% = 45 Degrees. Returns positive (or negative) infinity if line is vertical.

Extended Type: UnitVc

v : UnitVc
Returns: float

UnitVc.slopeRadians v

Full Usage: UnitVc.slopeRadians v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative slope of a 2D unit-vector in Radians. This is the same as the positive or negative angle to the X-axis (or its reverse). Range -1.57 to +1.57 Radians. This is just asin(v.Y).

Extended Type: UnitVc

v : UnitVc
Returns: float

UnitVc.withLength length v

Full Usage: UnitVc.withLength length v

Parameters:
Returns: Vc
Modifiers: inline

Multiplies a 2D unit-vector with a scalar, also called scaling a vector. Same as UnitVc.withLength. Returns a new (non-unitized) 2D vector.

Extended Type: UnitVc

length : float
v : UnitVc
Returns: Vc

UnitVc.withX x v

Full Usage: UnitVc.withX x v

Parameters:
Returns: Vc
Modifiers: inline

Returns new 2D vector with new X value, Y stays the same.

Extended Type: UnitVc

x : float
v : UnitVc
Returns: Vc

UnitVc.withY y v

Full Usage: UnitVc.withY y v

Parameters:
Returns: Vc
Modifiers: inline

Returns new 2D vector with new Y value, X stays the same.

Extended Type: UnitVc

y : float
v : UnitVc
Returns: Vc

UnitVc.withZ z v

Full Usage: UnitVc.withZ z v

Parameters:
Returns: Vec
Modifiers: inline

Returns new 3D vector with Z value, X and Y stay the same. If you want Z to be 0.0 you can use v.AsVec or v.AsUnitVec too.

Extended Type: UnitVc

z : float
v : UnitVc
Returns: Vec

Type something to start searching.