Header menu logo Euclid

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

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

b : Vc
Returns: float

this.AsPnt

Full Usage: this.AsPnt

Parameters:
    () : unit

Returns: Pnt
Modifiers: inline

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

Extended Type: Vc

() : unit
Returns: Pnt

this.AsPnt

Full Usage: this.AsPnt

Returns: Pnt
Modifiers: inline

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

Extended Type: Vc

Returns: Pnt

this.AsPt

Full Usage: this.AsPt

Parameters:
    () : unit

Returns: Pt
Modifiers: inline

Convert 2D vector to 2D point.

Extended Type: Vc

() : unit
Returns: Pt

this.AsPt

Full Usage: this.AsPt

Returns: Pt
Modifiers: inline

Convert 2D vector to 2D point.

Extended Type: Vc

Returns: Pt

this.AsVec

Full Usage: this.AsVec

Parameters:
    () : unit

Returns: Vec
Modifiers: inline

Convert 2D 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: Vc

() : unit
Returns: Vec

this.AsVec

Full Usage: this.AsVec

Returns: Vec
Modifiers: inline

Convert 2D 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: Vc

Returns: Vec

this.Cross

Full Usage: this.Cross

Parameters:
Returns: float
Modifiers: inline

The 2D Cross Product of two 2D 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: Vc

b : Vc
Returns: float

this.Cross

Full Usage: this.Cross

Parameters:
Returns: float
Modifiers: inline

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

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

() : 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: Vc

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

() : 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: Vc

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

() : 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: Vc

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

() : 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: Vc

Returns: float

this.DirectionPi

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

() : unit
Returns: float

this.DirectionPi

Full Usage: this.DirectionPi

Returns: float
Modifiers: inline

Returns the angle in Radians from X-axis. Going Counter-Clockwise till two Pi. Ignores orientation. Range 0.0 to Pi.

Extended Type: Vc

Returns: float

this.Dot

Full Usage: this.Dot

Parameters:
Returns: float
Modifiers: inline

Dot product, or scalar product of two 2D vectors. Returns a float.

Extended Type: Vc

b : Vc
Returns: float

this.Dot

Full Usage: this.Dot

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

b : UnitVc
Returns: float

this.Half

Full Usage: this.Half

Parameters:
    () : unit

Returns: Vc
Modifiers: inline

Returns a new 2D vector with half the length.

Extended Type: Vc

() : unit
Returns: Vc

this.Half

Full Usage: this.Half

Returns: Vc
Modifiers: inline

Returns a new 2D vector with half the length.

Extended Type: Vc

Returns: Vc

this.IsNotZero

Full Usage: this.IsNotZero

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns a boolean indicating if any of X and Y is not exactly 0.0.

Extended Type: Vc

() : unit
Returns: bool

this.IsNotZero

Full Usage: this.IsNotZero

Returns: bool
Modifiers: inline

Returns a boolean indicating if any of X and Y is not exactly 0.0.

Extended Type: Vc

Returns: bool

this.IsOppositeOrientation

Full Usage: this.IsOppositeOrientation

Parameters:
    other : Vc

Returns: bool
Modifiers: inline

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

Extended Type: Vc

other : Vc
Returns: bool

this.IsOppositeOrientation

Full Usage: this.IsOppositeOrientation

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between this 2D vectors and a 2D unit-vector is more than 180 degrees. Calculates the dot product of a 2D vector and a unit-vectors. Then checks if it is smaller than minus 1e-12. Fails if the vector is shorter than zeroLengthTolerance (1e-12).

Extended Type: Vc

other : UnitVc
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D vectors are parallel. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Vc

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

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks this 2D vectors and a 2D unit-vector are parallel. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Vc

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

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D vectors are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Vc

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

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if this 2D vectors and a 2D unit-vector are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Vc

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

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D vectors are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minium cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Vc

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

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if this 2D vectors and a 2D unit-vector are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minium cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. Fails on vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Vc

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

this.IsTiny

Full Usage: this.IsTiny

Parameters:
    tol : 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: Vc

tol : float
Returns: bool

this.IsTinySq

Full Usage: this.IsTinySq

Parameters:
    tol : 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: Vc

tol : float
Returns: bool

this.IsUnit

Full Usage: this.IsUnit

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Test if the 2D vector is a unit-vector. Tests if square length is within 6 float steps of 1.0 So between 0.99999964 and 1.000000715.

Extended Type: Vc

() : unit
Returns: bool

this.IsUnit

Full Usage: this.IsUnit

Returns: bool
Modifiers: inline

Test if the 2D vector is a unit-vector. Tests if square length is within 6 float steps of 1.0 So between 0.99999964 and 1.000000715.

Extended Type: Vc

Returns: bool

this.IsXAligned

Full Usage: this.IsXAligned

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 2D vector is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y axis is 1e-9. Fails on vectors shorter than 1e-6.

Extended Type: Vc

() : unit
Returns: bool

this.IsXAligned

Full Usage: this.IsXAligned

Returns: bool
Modifiers: inline

Checks if 2D vector is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y axis is 1e-9. Fails on vectors shorter than 1e-6.

Extended Type: Vc

Returns: bool

this.IsYAligned

Full Usage: this.IsYAligned

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 2D vector is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X axis is 1e-9. Fails on vectors shorter than 1e-6.

Extended Type: Vc

() : unit
Returns: bool

this.IsYAligned

Full Usage: this.IsYAligned

Returns: bool
Modifiers: inline

Checks if 2D vector is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X axis is 1e-9. Fails on vectors shorter than 1e-6.

Extended Type: Vc

Returns: bool

this.IsZero

Full Usage: this.IsZero

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns a boolean indicating wether X and Y are exactly 0.0.

Extended Type: Vc

() : unit
Returns: bool

this.IsZero

Full Usage: this.IsZero

Returns: bool
Modifiers: inline

Returns a boolean indicating wether X and Y are exactly 0.0.

Extended Type: Vc

Returns: bool

this.MatchesOrientation

Full Usage: this.MatchesOrientation

Parameters:
    other : Vc

Returns: bool
Modifiers: inline

Checks if the angle between the two 2D vectors is less than 180 degrees. Calculates the dot product of two 2D vectors. Then checks if it is bigger than 1e-12. Fails if any of the two vectors is shorter than zeroLengthTolerance (1e-12).

Extended Type: Vc

other : Vc
Returns: bool

this.MatchesOrientation

Full Usage: this.MatchesOrientation

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between this 2D vectors and a 2D unit-vector is less than 180 degrees. Calculates the dot product of a 2D vector and a unit-vectors. Then checks if it is bigger than 1e-12. Fails if the vector is shorter than zeroLengthTolerance (1e-12).

Extended Type: Vc

other : UnitVc
Returns: bool

this.Rotate

Full Usage: this.Rotate

Parameters:
    angDegree : float

Returns: Vc
Modifiers: inline

Rotate the 2D vector in Degrees. Counter Clockwise. For better Performance precomputed the Rotate2D struct and use its member to rotate. see Vc.RotateBy.

Extended Type: Vc

angDegree : float
Returns: Vc

this.Rotate90CCW

Full Usage: this.Rotate90CCW

Parameters:
    () : unit

Returns: Vc
Modifiers: inline

90 Degree rotation Counter-Clockwise.

Extended Type: Vc

() : unit
Returns: Vc

this.Rotate90CCW

Full Usage: this.Rotate90CCW

Returns: Vc
Modifiers: inline

90 Degree rotation Counter-Clockwise.

Extended Type: Vc

Returns: Vc

this.Rotate90CW

Full Usage: this.Rotate90CW

Parameters:
    () : unit

Returns: Vc
Modifiers: inline

90 Degree rotation clockwise.

Extended Type: Vc

() : unit
Returns: Vc

this.Rotate90CW

Full Usage: this.Rotate90CW

Returns: Vc
Modifiers: inline

90 Degree rotation clockwise.

Extended Type: Vc

Returns: Vc

this.RotateBy

Full Usage: this.RotateBy

Parameters:
Returns: Vc
Modifiers: inline

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

Extended Type: Vc

r : Rotation2D
Returns: Vc

this.Unitized

Full Usage: this.Unitized

Parameters:
    () : unit

Returns: UnitVc
Modifiers: inline

Returns the 2D vector unitized. Fails with EuclidDivByZeroException if the length of the vector is too small (1e-16) to unitize.

Extended Type: Vc

() : unit
Returns: UnitVc

this.Unitized

Full Usage: this.Unitized

Returns: UnitVc
Modifiers: inline

Returns the 2D vector unitized. Fails with EuclidDivByZeroException if the length of the vector is too small (1e-16) to unitize.

Extended Type: Vc

Returns: UnitVc

this.WithLength

Full Usage: this.WithLength

Parameters:
    desiredLength : float

Returns: Vc
Modifiers: inline

Returns a new 2D vector scaled to the desired length. Same as Vc.withLength.

Extended Type: Vc

desiredLength : float
Returns: Vc

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

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

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

Extended Type: Vc

z : float
Returns: Vec

Vc.Xaxis()

Full Usage: Vc.Xaxis()

Parameters:
    () : unit

Returns: Vc
Modifiers: inline

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

Extended Type: Vc

() : unit
Returns: Vc

Vc.Xaxis

Full Usage: Vc.Xaxis

Returns: Vc
Modifiers: inline

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

Extended Type: Vc

Returns: Vc

Vc.Yaxis()

Full Usage: Vc.Yaxis()

Parameters:
    () : unit

Returns: Vc
Modifiers: inline

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

Extended Type: Vc

() : unit
Returns: Vc

Vc.Yaxis

Full Usage: Vc.Yaxis

Returns: Vc
Modifiers: inline

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

Extended Type: Vc

Returns: Vc

Vc.add a b

Full Usage: Vc.add a b

Parameters:
Returns: Vc
Modifiers: inline

Add two 2D vectors together. Returns a new 2D vector.

Extended Type: Vc

a : Vc
b : Vc
Returns: Vc

Vc.angle180 a b

Full Usage: Vc.angle180 a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle between two 2D vectors in Degrees. Takes vector orientation into account. Range 0 to 180 Degrees.

Extended Type: Vc

a : Vc
b : Vc
Returns: float

Vc.angle2Pi (a, b)

Full Usage: Vc.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: Vc

a : Vc
b : Vc
Returns: float

Vc.angle360 (a, b)

Full Usage: Vc.angle360 (a, b)

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: Vc

a : Vc
b : Vc
Returns: float

Vc.angle90 a b

Full Usage: Vc.angle90 a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle between two 2D vectors in Degrees, Ignores vector orientation. Range: 0 to 90 Degrees.

Extended Type: Vc

a : Vc
b : Vc
Returns: float

Vc.angleDiamond (a, b)

Full Usage: Vc.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: Vc

a : Vc
b : Vc
Returns: float

Vc.angleHalfPi a b

Full Usage: Vc.angleHalfPi a b

Parameters:
Returns: float
Modifiers: inline

Returns positive angle between two 2D vectors in Radians. Ignores orientation. Range 0.0 to Pi/2 ( = 90 Degree)

Extended Type: Vc

a : Vc
b : Vc
Returns: float

Vc.anglePi a b

Full Usage: Vc.anglePi a b

Parameters:
Returns: float
Modifiers: inline

Returns angle between two 2D vectors in Radians. Takes vector orientation into account. Range 0.0 to Pi ( = 180 Degree)

Extended Type: Vc

a : Vc
b : Vc
Returns: float

Vc.angleToX180 v

Full Usage: Vc.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: Vc

v : Vc
Returns: float

Vc.angleToXPi vc

Full Usage: Vc.angleToXPi vc

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

vc : Vc
Returns: float

Vc.areParallel other v

Full Usage: Vc.areParallel other v

Parameters:
Returns: bool
Modifiers: inline

Checks if Angle between two vectors is Below 0.25 Degree. Ignores vector orientation. Fails on zero length vectors, tolerance 1e-12.

Extended Type: Vc

other : Vc
v : Vc
Returns: bool

Vc.areParallelAndMatchOrientation other v

Full Usage: Vc.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. Fails on zero length vectors, tolerance 1e-12.

Extended Type: Vc

other : Vc
v : Vc
Returns: bool

Vc.arePerpendicular other v

Full Usage: Vc.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. Fails on zero length vectors, tolerance 1e-12.

Extended Type: Vc

other : Vc
v : Vc
Returns: bool

Vc.asPnt v

Full Usage: Vc.asPnt v

Parameters:
Returns: Pnt
Modifiers: inline

Convert 2D vector to 3D point. Using 0.0 as Z value.

Extended Type: Vc

v : Vc
Returns: Pnt

Vc.asPt v

Full Usage: Vc.asPt v

Parameters:
Returns: Pt
Modifiers: inline

Convert 2D vector to 2D point.

Extended Type: Vc

v : Vc
Returns: Pt

Vc.asVec v

Full Usage: Vc.asVec v

Parameters:
Returns: Vec
Modifiers: inline

Convert 2D vector to 3D vector. Using 0.0 as Z value.

Extended Type: Vc

v : Vc
Returns: Vec

Vc.bisector a b

Full Usage: Vc.bisector a b

Parameters:
Returns: Vc
Modifiers: inline

Returns a bisector vector in the middle direction. Code : a.Unitized + b.Unitized

Extended Type: Vc

a : Vc
b : Vc
Returns: Vc

Vc.create (x, y)

Full Usage: Vc.create (x, y)

Parameters:
    x : float
    y : float

Returns: Vc
Modifiers: inline

Returns a new 2D vector from X and Y parts.

Extended Type: Vc

x : float
y : float
Returns: Vc

Vc.create (start, ende)

Full Usage: Vc.create (start, ende)

Parameters:
    start : Pt
    ende : Pt

Returns: Vc
Modifiers: inline

Returns a new 2D vector from start and end point.

Extended Type: Vc

start : Pt
ende : Pt
Returns: Vc

Vc.createFromMembersXY vec

Full Usage: Vc.createFromMembersXY vec

Parameters:
    vec : ^T

Returns: Vc
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. Internally this is not using reflection at runtime but F# Statically Resolved Type Parameters at compile time.

Extended Type: Vc

vec : ^T
Returns: Vc

Vc.createFromMembersxy vec

Full Usage: Vc.createFromMembersxy vec

Parameters:
    vec : ^T

Returns: Vc
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. Internally this is not using reflection at runtime but F# Statically Resolved Type Parameters at compile time.

Extended Type: Vc

vec : ^T
Returns: Vc

Vc.createFromPt pt

Full Usage: Vc.createFromPt pt

Parameters:
Returns: Vc
Modifiers: inline

Create 2D vector from 2D point.

Extended Type: Vc

pt : Pnt
Returns: Vc

Vc.createFromUnitVc v

Full Usage: Vc.createFromUnitVc v

Parameters:
Returns: Vc
Modifiers: inline

Create 2D vector from 2D unit-vector.

Extended Type: Vc

v : UnitVc
Returns: Vc

Vc.cross (a, b)

Full Usage: Vc.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: Vc

a : Vc
b : Vc
Returns: float

Vc.cross (a, b)

Full Usage: Vc.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: Vc

a : UnitVc
b : Vc
Returns: float

Vc.cross (a, b)

Full Usage: Vc.cross (a, b)

Parameters:
Returns: float
Modifiers: inline

The 2D Cross 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: Vc

a : Vc
b : UnitVc
Returns: float

Vc.difference a b

Full Usage: Vc.difference a b

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: Vc

a : Vc
b : Vc
Returns: float

Vc.differenceSq a b

Full Usage: Vc.differenceSq a b

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: Vc

a : Vc
b : Vc
Returns: float

Vc.direction2Pi v

Full Usage: Vc.direction2Pi v

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: Vc

v : Vc
Returns: float

Vc.direction360 v

Full Usage: Vc.direction360 v

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: Vc

v : Vc
Returns: float

Vc.directionDiamond a

Full Usage: Vc.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: Vc

a : Vc
Returns: float

Vc.dot (a, b)

Full Usage: Vc.dot (a, b)

Parameters:
Returns: float
Modifiers: inline

Dot product, or scalar product of two 2D vectors. Returns a float.

Extended Type: Vc

a : Vc
b : Vc
Returns: float

Vc.dot (a, b)

Full Usage: Vc.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: Vc

a : Vc
b : UnitVc
Returns: float

Vc.dot (a, b)

Full Usage: Vc.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: Vc

a : UnitVc
b : Vc
Returns: float

Vc.equals tol a b

Full Usage: Vc.equals tol a b

Parameters:
    tol : float
    a : Vc
    b : Vc

Returns: bool
Modifiers: inline

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

Extended Type: Vc

tol : float
a : Vc
b : Vc
Returns: bool

Vc.flip v

Full Usage: Vc.flip v

Parameters:
Returns: Vc
Modifiers: inline

Negate or inverse a 2D vectors. Returns a new 2D vector. Same as Vc.reverse.

Extended Type: Vc

v : Vc
Returns: Vc

Vc.getX v

Full Usage: Vc.getX v

Parameters:
Returns: float
Modifiers: inline

Gets the X part of this 2D vector.

Extended Type: Vc

v : Vc
Returns: float

Vc.getY v

Full Usage: Vc.getY v

Parameters:
Returns: float
Modifiers: inline

Gets the Y part of this 2D vector.

Extended Type: Vc

v : Vc
Returns: float

Vc.intersection (ptA, ptB, vA, vB, tooShortTolerance, relAngleDiscriminant)

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

Parameters:
    ptA : Pt - The start point of the first line.
    ptB : Pt - The start point of the second line.
    vA : Vc - The vector of the first line.
    vB : Vc - The vector of the second line.
    tooShortTolerance : float - Is an optional length tolerance. 1e-6 by default. If one or both vectors are shorter than this ValueNone is returned.
    relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>> - This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value corresponds to approx 0.25 degree. Below this angle vectors are considered parallel. See module Euclid.UtilEuclid.RelAngleDiscriminant

Returns: ValueOption<float * float> For (almost) zero length or (almost) parallel vectors: ValueNone Else ValueSome with a tuple of the parameters at which the two infinite 2D Lines intersect to each other. The tuple's order corresponds to the input order.

Intersects two infinite 2D lines. The lines are defined by a start point and a vector.

Extended Type: Vc

ptA : Pt

The start point of the first line.

ptB : Pt

The start point of the second line.

vA : Vc

The vector of the first line.

vB : Vc

The vector of the second line.

tooShortTolerance : float

Is an optional length tolerance. 1e-6 by default. If one or both vectors are shorter than this ValueNone is returned.

relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>>

This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value corresponds to approx 0.25 degree. Below this angle vectors are considered parallel. See module Euclid.UtilEuclid.RelAngleDiscriminant

Returns: ValueOption<float * float>

For (almost) zero length or (almost) parallel vectors: ValueNone Else ValueSome with a tuple of the parameters at which the two infinite 2D Lines intersect to each other. The tuple's order corresponds to the input order.

Vc.isAngle180Above cosineValue a b

Full Usage: Vc.isAngle180Above cosineValue a b

Parameters:
Returns: bool
Modifiers: inline

Checks if Angle between two vectors is more than given Cosine. Does not ignores vector orientation.The angle between two vectors can be 0 to 180 degrees. Use the Euclid.Cosine module to get some precomputed cosine values. Fails on zero length vectors, tolerance 1e-12.

Extended Type: Vc

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

Vc.isAngle180Below cosineValue a b

Full Usage: Vc.isAngle180Below cosineValue a b

Parameters:
Returns: bool
Modifiers: inline

Checks if Angle between two vectors is less than given Cosine. Does not ignores vector orientation.The angle between two vectors can be 0 to 180 degrees. Use the Euclid.Cosine module to get some precomputed cosine values Fails on zero length vectors, tolerance 1e-12.

Extended Type: Vc

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

Vc.isAngle90Above cosineValue a b

Full Usage: Vc.isAngle90Above cosineValue a b

Parameters:
Returns: bool
Modifiers: inline

Checks if Angle between two vectors is more than given Cosine. Ignores vector orientation. The angle between two vectors can be 0 to 90 degrees ignoring their direction. Use the Euclid.Cosine module to get some precomputed cosine values. Fails on zero length vectors, tolerance 1e-12.

Extended Type: Vc

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

Vc.isAngle90Below cosineValue a b

Full Usage: Vc.isAngle90Below cosineValue a b

Parameters:
Returns: bool
Modifiers: inline

Checks if Angle between two vectors is less than given Cosine. Ignores vector orientation. The angle between two vectors can be 0 to 90 degrees ignoring their direction. Use the Euclid.Cosine module to get some precomputed cosine values Fails on zero length vectors, tolerance 1e-12.

Extended Type: Vc

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

Vc.isOppositeOrientation v other

Full Usage: Vc.isOppositeOrientation v other

Parameters:
Returns: bool
Modifiers: inline

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

Extended Type: Vc

v : Vc
other : Vc
Returns: bool

Vc.isTiny tol v

Full Usage: Vc.isTiny tol v

Parameters:
    tol : float
    v : Vc

Returns: bool
Modifiers: inline

Check if the 2D vector is shorter than the tolerance. Also checks if any component is a NaN.

Extended Type: Vc

tol : float
v : Vc
Returns: bool

Vc.isTinySq tol v

Full Usage: Vc.isTinySq tol v

Parameters:
    tol : float
    v : Vc

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

tol : float
v : Vc
Returns: bool

Vc.isXAligned v

Full Usage: Vc.isXAligned v

Parameters:
Returns: bool
Modifiers: inline

Tolerance is 1e-6. Fails on vectors shorter than 1e-6.

Extended Type: Vc

v : Vc
Returns: bool

Vc.isYAligned v

Full Usage: Vc.isYAligned v

Parameters:
Returns: bool
Modifiers: inline

Checks if 2D vector is parallel to the world Y axis. Ignoring orientation. Tolerance is 1e-6. Fails on vectors shorter than 1e-6.

Extended Type: Vc

v : Vc
Returns: bool

Vc.length v

Full Usage: Vc.length v

Parameters:
Returns: float
Modifiers: inline

Returns the length of the 2D vector.

Extended Type: Vc

v : Vc
Returns: float

Vc.lengthSq v

Full Usage: Vc.lengthSq v

Parameters:
Returns: float
Modifiers: inline

Returns the squared length of the 2D vector. The square length is faster to calculate and often good enough for use cases such as sorting vectors by length.

Extended Type: Vc

v : Vc
Returns: float

Vc.lerp (start, ende, rel)

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

Parameters:
    start : Vc
    ende : Vc
    rel : float

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

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

Vc.matchOrientation orientationToMatch vecToFlip

Full Usage: Vc.matchOrientation orientationToMatch vecToFlip

Parameters:
    orientationToMatch : Vc
    vecToFlip : Vc

Returns: Vc
Modifiers: inline

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

Extended Type: Vc

orientationToMatch : Vc
vecToFlip : Vc
Returns: Vc

Vc.matchUnitVcOrientation orientationToMatch vecToFlip

Full Usage: Vc.matchUnitVcOrientation orientationToMatch vecToFlip

Parameters:
    orientationToMatch : UnitVc
    vecToFlip : Vc

Returns: Vc
Modifiers: inline

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

Extended Type: Vc

orientationToMatch : UnitVc
vecToFlip : Vc
Returns: Vc

Vc.matchesOrientation v other

Full Usage: Vc.matchesOrientation v other

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 2D vectors is less than 180 degrees. Calculates the dot product of two 2D vectors. Then checks if it is bigger than 1e-12. If any of the two vectors is zero length returns false.

Extended Type: Vc

v : Vc
other : Vc
Returns: bool

Vc.moveX x v

Full Usage: Vc.moveX x v

Parameters:
    x : float
    v : Vc

Returns: Vc
Modifiers: inline

Add to the X part of this 2D vectors together. Returns a new 2D vector.

Extended Type: Vc

x : float
v : Vc
Returns: Vc

Vc.moveY y v

Full Usage: Vc.moveY y v

Parameters:
    y : float
    v : Vc

Returns: Vc
Modifiers: inline

Add to the Y part of this 2D vectors together. Returns a new 2D vector.

Extended Type: Vc

y : float
v : Vc
Returns: Vc

Vc.notEquals tol a b

Full Usage: Vc.notEquals tol a b

Parameters:
    tol : float
    a : Vc
    b : Vc

Returns: bool

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

Extended Type: Vc

tol : float
a : Vc
b : Vc
Returns: bool

Vc.reverse v

Full Usage: Vc.reverse v

Parameters:
Returns: Vc
Modifiers: inline

Negate or inverse a 2D vectors. Returns a new 2D vector. Same as Vc.flip.

Extended Type: Vc

v : Vc
Returns: Vc

Vc.rotate angDegree vec

Full Usage: Vc.rotate angDegree vec

Parameters:
    angDegree : float
    vec : Vc

Returns: Vc
Modifiers: inline

Rotate the 2D vector in Degrees. Counter Clockwise. For better Performance precomputed the Rotate2D struct and use its member to rotate. see Vc.rotateBy.

Extended Type: Vc

angDegree : float
vec : Vc
Returns: Vc

Vc.rotate90CCW v

Full Usage: Vc.rotate90CCW v

Parameters:
Returns: Vc
Modifiers: inline

90 Degree rotation Counter-Clockwise.

Extended Type: Vc

v : Vc
Returns: Vc

Vc.rotate90CW v

Full Usage: Vc.rotate90CW v

Parameters:
Returns: Vc
Modifiers: inline

90 Degree rotation clockwise.

Extended Type: Vc

v : Vc
Returns: Vc

Vc.rotateBy r v

Full Usage: Vc.rotateBy r v

Parameters:
Returns: Vc
Modifiers: inline

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

Extended Type: Vc

r : Rotation2D
v : Vc
Returns: Vc

Vc.rotateByQuarterCircle numberOfQuarters v

Full Usage: Vc.rotateByQuarterCircle numberOfQuarters v

Parameters:
    numberOfQuarters : int
    v : Vc

Returns: Vc

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

numberOfQuarters : int
v : Vc
Returns: Vc

Vc.scale f v

Full Usage: Vc.scale f v

Parameters:
    f : float
    v : Vc

Returns: Vc
Modifiers: inline

Multiplies a 2D vector with a scalar, also called scaling a vector. Same as Vc.withLength. Returns a new 2D vector.

Extended Type: Vc

f : float
v : Vc
Returns: Vc

Vc.slerp (start, ende, rel)

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

Parameters:
    start : Vc
    ende : Vc
    rel : float

Returns: Vc

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

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

Vc.slopeDegrees v

Full Usage: Vc.slopeDegrees v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative slope of a 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 Math.Atan2(v.Y, v.X).

Extended Type: Vc

v : Vc
Returns: float

Vc.slopePercent v

Full Usage: Vc.slopePercent v

Parameters:
Returns: float
Modifiers: inline

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

Extended Type: Vc

v : Vc
Returns: float

Vc.slopeRadians v

Full Usage: Vc.slopeRadians v

Parameters:
Returns: float
Modifiers: inline

Returns positive or negative slope of a 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 Math.Atan2(v.Y, v.X).

Extended Type: Vc

v : Vc
Returns: float

Vc.unitize v

Full Usage: Vc.unitize v

Parameters:
Returns: UnitVc
Modifiers: inline

Returns 2D vector unitized, fails on zero length vectors.

Extended Type: Vc

v : Vc
Returns: UnitVc

Vc.unitizeOrDefault defaultUnitVector v

Full Usage: Vc.unitizeOrDefault defaultUnitVector v

Parameters:
Returns: UnitVc
Modifiers: inline

Unitize 2D vector, if input vector is shorter than 1e-6 the default unit-vector is returned.

Extended Type: Vc

defaultUnitVector : UnitVc
v : Vc
Returns: UnitVc

Vc.withLength desiredLength v

Full Usage: Vc.withLength desiredLength v

Parameters:
    desiredLength : float
    v : Vc

Returns: Vc
Modifiers: inline

Returns a new 2D vector scaled to the desired length. Same as vc.WithLength. Returns a new 2D vector.

Extended Type: Vc

desiredLength : float
v : Vc
Returns: Vc

Vc.withX x v

Full Usage: Vc.withX x v

Parameters:
    x : float
    v : Vc

Returns: Vc
Modifiers: inline

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

Extended Type: Vc

x : float
v : Vc
Returns: Vc

Vc.withY y v

Full Usage: Vc.withY y v

Parameters:
    y : float
    v : Vc

Returns: Vc
Modifiers: inline

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

Extended Type: Vc

y : float
v : Vc
Returns: Vc

Type something to start searching.