Vector3

Overview

Vector3 is a struct in Aspose.3D FOSS for .NET. Inherits from: IComparable<Vector3>.

The Vector3 class supplies full 3‑D vector mathematics, including dot product, cross product, normalization, and angle calculations between directions.

This struct provides 13 methods for working with Vector3 objects in .NET programs. Available methods include: AngleBetween, CompareTo, Cos, Cross, Dot, Equals, GetHashCode, Normalize, Parse, Set, Sin, ToString, and 1 additional methods. All public members are accessible to any .NET application after installing the Aspose.3D FOSS for .NET package. Properties: Item, Length, Length2, One, UnitX, UnitY, and 2 more.

Properties

NameTypeAccessDescription
ItemdoubleRead/WriteGets or sets the item.
Length2doubleReadGets the length2.
LengthdoubleReadGets the length.
ZeroVector3ReadGets the zero.
OneVector3ReadGets the one.
UnitXVector3ReadGets the unit x.
UnitYVector3ReadGets the unit y.
UnitZVector3ReadGets the unit z.

Methods

SignatureDescription
Vector3(x: double, y: double, z: double)Creates a vector from a Vector4, discarding the w component
Vector3(vec: FVector3)
Vector3(v: double)
Vector3(vec4: Vector4)
Parse(input: string)Converts a string representation into a Vector3
Equals(obj: object)Determines whether the given object is equal to this vector
GetHashCode()
Dot(rhs: Vector3)Returns the dot product of this vector with another
Normalize()Scales the vector to unit length
Sin()Returns a vector of the sine of each component
Cos()Returns a vector of the cosine of each component
Cross(rhs: Vector3)
Set(newX: double, newY: double, newZ: double)Assigns new x, y, z values to the vector
ToString()Returns a string representation of the vector
AngleBetween(dir: Vector3, up: Vector3)Computes the signed angle to dir using up as reference
AngleBetween(dir: Vector3)
CompareTo(other: Vector3)Compares this vector to another for sorting

See Also