Table of Contents

Struct LengthVector3

Namespace
Thunder.UnitsNET.Vectors
Assembly
Thunder.UnitsNET.Vectors.dll

A 3D vector whose components represent length, each expressed as a UnitsNet.Length.

public readonly record struct LengthVector3 : IEquatable<LengthVector3>
Implements
Inherited Members
Extension Methods

Constructors

LengthVector3(Length, Length, Length)

Constructs a LengthVector3 from three UnitsNet.Length components.

public LengthVector3(Length x, Length y, Length z)

Parameters

x Length

The X component.

y Length

The Y component.

z Length

The Z component.

Properties

Magnitude

Returns the Euclidean magnitude of this vector as a UnitsNet.Length. The result is expressed in the same unit as the X component.

public Length Magnitude { get; }

Property Value

Length

X

The X component.

public Length X { get; }

Property Value

Length

Y

The Y component.

public Length Y { get; }

Property Value

Length

Z

The Z component.

public Length Z { get; }

Property Value

Length

Zero

A LengthVector3 with all components set to zero.

public static LengthVector3 Zero { get; }

Property Value

LengthVector3

Methods

Abs()

Returns a vector with each component replaced by its absolute value.

public LengthVector3 Abs()

Returns

LengthVector3

A LengthVector3 with non-negative components.

Add(LengthVector3)

Adds two vectors component-wise.

public LengthVector3 Add(LengthVector3 other)

Parameters

other LengthVector3

The vector to add.

Returns

LengthVector3

The component-wise sum.

AngleTo(LengthVector3)

Returns the unsigned angle between this vector and other, in the range [0, π] radians (0° to 180°).

Computed as acos(dot(a, b) / (|a| · |b|)). The result is always non-negative and has no concept of clockwise or counter-clockwise in 3D. Use this when you only need to know how far apart two directions are, regardless of orientation (e.g. checking whether two vectors are nearly parallel).

public Angle AngleTo(LengthVector3 other)

Parameters

other LengthVector3

The other direction vector.

Returns

Angle

The unsigned angle between the two vectors, in [0, π].

Examples

var up      = new LengthVector3(Length.FromMeters(0), Length.FromMeters(1), Length.FromMeters(0));
var forward = new LengthVector3(Length.FromMeters(0), Length.FromMeters(0), Length.FromMeters(1));
Angle a = up.AngleTo(forward); // π/2 = 90° — perpendicular

AngleTo(LengthVector3, DoubleVector3)

Returns the signed angle from this vector to other, measured around normal, in the range (−π, π].

A positive result means other is counter-clockwise from this vector when viewed from the tip of normal (right-hand rule). Computed via atan2(dot(normal, this×other), dot(this, other)).

public Angle AngleTo(LengthVector3 other, DoubleVector3 normal)

Parameters

other LengthVector3

The target direction vector.

normal DoubleVector3

The reference axis (should be a unit vector perpendicular to both input vectors for the sign to be meaningful). Positive result = CCW from tip of normal.

Returns

Angle

The signed angle from this vector to other, in (−π, π].

Examples

var right   = new LengthVector3(Length.FromMeters(1), Length.Zero, Length.Zero);
var forward = new LengthVector3(Length.Zero, Length.Zero, Length.FromMeters(1));
var up      = new DoubleVector3(0, 1, 0);
Angle a1 = right.AngleTo(forward, up);   // +90°
Angle a2 = forward.AngleTo(right, up);   // -90°

ApproximatelyEquals(LengthVector3, Length)

Returns true if each component of this vector is within tolerance of the corresponding component of other.

public bool ApproximatelyEquals(LengthVector3 other, Length tolerance)

Parameters

other LengthVector3

The vector to compare against.

tolerance Length

The maximum allowed difference per component (inclusive).

Returns

bool

true when |X - other.X| <= tolerance, |Y - other.Y| <= tolerance, and |Z - other.Z| <= tolerance.

As(LengthUnit)

Projects all three components into the requested unit, returning a unit-less DoubleVector3.

public DoubleVector3 As(LengthUnit unit)

Parameters

unit LengthUnit

The target unit for each component.

Returns

DoubleVector3

A DoubleVector3 with components expressed in unit.

AsDefault()

Returns all three components expressed in the SI base unit as a DoubleVector3.

public DoubleVector3 AsDefault()

Returns

DoubleVector3

A DoubleVector3 with components in the default SI unit.

Clamp(LengthVector3, LengthVector3)

Returns a vector with each component clamped to the range [min, max].

public LengthVector3 Clamp(LengthVector3 min, LengthVector3 max)

Parameters

min LengthVector3

The lower bound vector (inclusive, per component).

max LengthVector3

The upper bound vector (inclusive, per component).

Returns

LengthVector3

A LengthVector3 with each component in [min, max].

DistanceTo(LengthVector3)

Returns the straight-line Euclidean distance between this position and other.

Computed as √((Δx)² + (Δy)² + (Δz)²) using the 3D Pythagorean theorem. The result is always a non-negative UnitsNet.Length in the same unit as the components.

public Length DistanceTo(LengthVector3 other)

Parameters

other LengthVector3

The target position.

Returns

Length

The straight-line distance between the two positions, always ≥ 0.

Examples

var a = new LengthVector3(Length.FromMeters(0), Length.FromMeters(0), Length.FromMeters(0));
var b = new LengthVector3(Length.FromMeters(1), Length.FromMeters(2), Length.FromMeters(2));
Length d = a.DistanceTo(b); // 3 m — because √(1+4+4) = 3

Divide(double)

Divides the vector by a scalar divisor.

public LengthVector3 Divide(double scalar)

Parameters

scalar double

The scalar divisor.

Returns

LengthVector3

The divided vector.

Dot(ForceVector3)

Returns the scalar work done by other along this displacement (W = d⃗ · F⃗ = X·Fx + Y·Fy + Z·Fz), expressed as UnitsNet.Energy.

Work is only done by the component of force that is aligned with the direction of motion: W = |F| · |d| · cos(θ). A force perpendicular to the motion does no work. In 3D, forces and displacements can be at arbitrary angles; the dot product correctly extracts only the "useful" component of the force. Negative work means the force opposes the motion (e.g. friction, air resistance).

public Energy Dot(ForceVector3 other)

Parameters

other ForceVector3

The force vector acting along (or against) the displacement.

Returns

Energy

The work done in the natural unit for this displacement/force pair.

Examples

// A 100 N force rightward (+X), object displaced 5 m rightward and 3 m upward
var displacement = new LengthVector3(
    Length.FromMeters(5), Length.FromMeters(3), Length.FromMeters(0));
var force = new ForceVector3(Force.FromNewtons(100), Force.Zero, Force.Zero);
Energy work = displacement.Dot(force); // 500 J — only X component contributes

Dot(LengthVector3)

Returns the dot product of this displacement vector with other, expressed as UnitsNet.Area (A = x⃗ · x⃗ = X·other.X + Y·other.Y + Z·other.Z).

Geometrically this equals |a|·|b|·cos(θ). The result represents the scalar projection of one vector onto the other, multiplied by the other's magnitude. For two perpendicular displacement vectors the dot product is zero; for parallel ones it equals the product of their lengths. A common use is projecting a displacement onto a known direction to find how far "along" that direction the point lies.

public Area Dot(LengthVector3 other)

Parameters

other LengthVector3

The other displacement vector.

Returns

Area

The scalar dot product expressed as an UnitsNet.Area, in the squared unit of this vector's components.

Examples

var a = new LengthVector3(Length.FromMeters(3), Length.FromMeters(0), Length.FromMeters(4));
var b = new LengthVector3(Length.FromMeters(3), Length.FromMeters(0), Length.FromMeters(4));
Area dot = a.Dot(b); // 25 m² — because 9 + 0 + 16 = 25

Equals(LengthVector3)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(LengthVector3 other)

Parameters

other LengthVector3

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

FromAngstroms(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromAngstroms(UnitsNet.QuantityValue).

public static LengthVector3 FromAngstroms(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromAstronomicalUnits(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromAstronomicalUnits(UnitsNet.QuantityValue).

public static LengthVector3 FromAstronomicalUnits(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromCentimeters(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromCentimeters(UnitsNet.QuantityValue).

public static LengthVector3 FromCentimeters(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromChains(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromChains(UnitsNet.QuantityValue).

public static LengthVector3 FromChains(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromDataMiles(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromDataMiles(UnitsNet.QuantityValue).

public static LengthVector3 FromDataMiles(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromDecameters(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromDecameters(UnitsNet.QuantityValue).

public static LengthVector3 FromDecameters(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromDecimeters(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromDecimeters(UnitsNet.QuantityValue).

public static LengthVector3 FromDecimeters(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromDtpPicas(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromDtpPicas(UnitsNet.QuantityValue).

public static LengthVector3 FromDtpPicas(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromDtpPoints(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromDtpPoints(UnitsNet.QuantityValue).

public static LengthVector3 FromDtpPoints(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromFathoms(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromFathoms(UnitsNet.QuantityValue).

public static LengthVector3 FromFathoms(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromFeet(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromFeet(UnitsNet.QuantityValue).

public static LengthVector3 FromFeet(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromFemtometers(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromFemtometers(UnitsNet.QuantityValue).

public static LengthVector3 FromFemtometers(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromGigameters(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromGigameters(UnitsNet.QuantityValue).

public static LengthVector3 FromGigameters(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromHands(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromHands(UnitsNet.QuantityValue).

public static LengthVector3 FromHands(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromHectometers(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromHectometers(UnitsNet.QuantityValue).

public static LengthVector3 FromHectometers(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromInches(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromInches(UnitsNet.QuantityValue).

public static LengthVector3 FromInches(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromKilofeet(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromKilofeet(UnitsNet.QuantityValue).

public static LengthVector3 FromKilofeet(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromKilolightYears(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromKilolightYears(UnitsNet.QuantityValue).

public static LengthVector3 FromKilolightYears(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromKilometers(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromKilometers(UnitsNet.QuantityValue).

public static LengthVector3 FromKilometers(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromKiloparsecs(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromKiloparsecs(UnitsNet.QuantityValue).

public static LengthVector3 FromKiloparsecs(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromKiloyards(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromKiloyards(UnitsNet.QuantityValue).

public static LengthVector3 FromKiloyards(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromLightYears(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromLightYears(UnitsNet.QuantityValue).

public static LengthVector3 FromLightYears(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromMegalightYears(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromMegalightYears(UnitsNet.QuantityValue).

public static LengthVector3 FromMegalightYears(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromMegameters(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromMegameters(UnitsNet.QuantityValue).

public static LengthVector3 FromMegameters(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromMegaparsecs(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromMegaparsecs(UnitsNet.QuantityValue).

public static LengthVector3 FromMegaparsecs(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromMeters(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromMeters(UnitsNet.QuantityValue).

public static LengthVector3 FromMeters(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromMicroinches(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromMicroinches(UnitsNet.QuantityValue).

public static LengthVector3 FromMicroinches(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromMicrometers(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromMicrometers(UnitsNet.QuantityValue).

public static LengthVector3 FromMicrometers(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromMiles(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromMiles(UnitsNet.QuantityValue).

public static LengthVector3 FromMiles(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromMillimeters(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromMillimeters(UnitsNet.QuantityValue).

public static LengthVector3 FromMillimeters(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromMils(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromMils(UnitsNet.QuantityValue).

public static LengthVector3 FromMils(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromNanometers(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromNanometers(UnitsNet.QuantityValue).

public static LengthVector3 FromNanometers(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromNauticalMiles(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromNauticalMiles(UnitsNet.QuantityValue).

public static LengthVector3 FromNauticalMiles(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromParsecs(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromParsecs(UnitsNet.QuantityValue).

public static LengthVector3 FromParsecs(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromPicometers(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromPicometers(UnitsNet.QuantityValue).

public static LengthVector3 FromPicometers(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromPrinterPicas(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromPrinterPicas(UnitsNet.QuantityValue).

public static LengthVector3 FromPrinterPicas(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromPrinterPoints(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromPrinterPoints(UnitsNet.QuantityValue).

public static LengthVector3 FromPrinterPoints(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromShackles(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromShackles(UnitsNet.QuantityValue).

public static LengthVector3 FromShackles(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromSolarRadiuses(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromSolarRadiuses(UnitsNet.QuantityValue).

public static LengthVector3 FromSolarRadiuses(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromTwips(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromTwips(UnitsNet.QuantityValue).

public static LengthVector3 FromTwips(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromUsSurveyFeet(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromUsSurveyFeet(UnitsNet.QuantityValue).

public static LengthVector3 FromUsSurveyFeet(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

FromYards(double, double, double)

Creates a LengthVector3 with all components created via UnitsNet.Length.FromYards(UnitsNet.QuantityValue).

public static LengthVector3 FromYards(double x, double y, double z)

Parameters

x double

The X component value.

y double

The Y component value.

z double

The Z component value.

Returns

LengthVector3

A LengthVector3 with all components in the corresponding unit.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Lerp(LengthVector3, LengthVector3, double)

Linearly interpolates between two vectors.

The result at t = 0 is a; at t = 1 it is b. Values of t outside [0, 1] extrapolate beyond the endpoints — use LerpClamped(LengthVector3, LengthVector3, double) if you need the result bounded to the segment between a and b.

public static LengthVector3 Lerp(LengthVector3 a, LengthVector3 b, double t)

Parameters

a LengthVector3

The start vector (t = 0).

b LengthVector3

The end vector (t = 1).

t double

The interpolation parameter. Values outside [0, 1] extrapolate.

Returns

LengthVector3

The interpolated LengthVector3.

LerpClamped(LengthVector3, LengthVector3, double)

Linearly interpolates between two vectors, with t clamped to [0, 1].

public static LengthVector3 LerpClamped(LengthVector3 a, LengthVector3 b, double t)

Parameters

a LengthVector3

The start vector (t = 0).

b LengthVector3

The end vector (t = 1).

t double

The interpolation parameter, clamped to [0, 1].

Returns

LengthVector3

The interpolated LengthVector3, always between a and b.

Multiply(double)

Scales the vector by a scalar factor.

public LengthVector3 Multiply(double scalar)

Parameters

scalar double

The scalar factor.

Returns

LengthVector3

The scaled vector.

Negate()

Negates all components.

public LengthVector3 Negate()

Returns

LengthVector3

A vector with all components negated.

Normalize()

Returns a dimensionless unit vector pointing in the same direction. For a zero vector, Zero is returned.

public DoubleVector3 Normalize()

Returns

DoubleVector3

A unit-length DoubleVector3 in the same direction.

Subtract(LengthVector3)

Subtracts two vectors component-wise.

public LengthVector3 Subtract(LengthVector3 other)

Parameters

other LengthVector3

The vector to subtract.

Returns

LengthVector3

The component-wise difference.

Truncate()

Projects this vector onto the XY plane by discarding the Z component.

The X and Y components — including their units — are preserved exactly. Z is dropped. This is the inverse of Extend(Length).

public LengthVector2 Truncate()

Returns

LengthVector2

A LengthVector2 with the same X and Y as this vector.

Examples

var v3 = LengthVector3.FromMeters(3, 4, 5);
LengthVector2 v2 = v3.Truncate(); // (3 m, 4 m)

Operators

operator +(LengthVector3, LengthVector3)

Adds two vectors component-wise.

public static LengthVector3 operator +(LengthVector3 left, LengthVector3 right)

Parameters

left LengthVector3

The left operand.

right LengthVector3

The right operand.

Returns

LengthVector3

The component-wise sum.

operator /(LengthVector3, double)

Divides the vector by a scalar divisor.

public static LengthVector3 operator /(LengthVector3 left, double scalar)

Parameters

left LengthVector3

The vector to divide.

scalar double

The scalar divisor.

Returns

LengthVector3

The divided vector.

operator /(LengthVector3, Duration)

Divides a LengthVector3 by a UnitsNet.Duration to produce a SpeedVector3.

public static SpeedVector3 operator /(LengthVector3 left, Duration right)

Parameters

left LengthVector3

The left operand.

right Duration

The right operand.

Returns

SpeedVector3

A SpeedVector3.

operator *(double, LengthVector3)

Scales the vector by a scalar factor. Operands may be supplied in either order.

public static LengthVector3 operator *(double scalar, LengthVector3 right)

Parameters

scalar double

The scalar factor.

right LengthVector3

The vector to scale.

Returns

LengthVector3

The scaled vector.

operator *(LengthVector3, double)

Scales the vector by a scalar factor.

public static LengthVector3 operator *(LengthVector3 left, double scalar)

Parameters

left LengthVector3

The vector to scale.

scalar double

The scalar factor.

Returns

LengthVector3

The scaled vector.

operator -(LengthVector3, LengthVector3)

Subtracts two vectors component-wise.

public static LengthVector3 operator -(LengthVector3 left, LengthVector3 right)

Parameters

left LengthVector3

The left operand.

right LengthVector3

The right operand.

Returns

LengthVector3

The component-wise difference.

operator -(LengthVector3)

Negates all components.

public static LengthVector3 operator -(LengthVector3 value)

Parameters

value LengthVector3

The vector to negate.

Returns

LengthVector3

A vector with all components negated.

latest ▼