Vector2

Overview

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

Vector2.Vector2 creates a vector with both components set to the given scalar.

This struct provides 8 methods for working with Vector2 objects in .NET programs. Available methods include: CompareTo, Cross, Dot, Equals, GetHashCode, Normalize, ToString, Vector2. All public members are accessible to any .NET application after installing the Aspose.3D FOSS for .NET package. Properties: Length, U, V.

Properties

NameTypeAccessDescription
UdoubleRead/WriteGets or sets the u.
VdoubleRead/WriteGets or sets the v.
LengthdoubleReadGets the length.

Methods

SignatureDescription
Vector2(s: double)Creates a 2‑D vector from a Vector3, using its X and Y components
Vector2(x: double, y: double)
Vector2(s: Vector3)
Vector2(vec: FVector2)
Dot(rhs: Vector2)Returns the dot product of this vector and the right‑hand side vector
Equals(rhs: Vector2)Determines whether the supplied object is a Vector2 with equal components
Equals(obj: object?)
GetHashCode()Returns a hash code derived from the vector’s components
ToString()Returns a textual representation of the vector’s components
Cross(v: Vector2)Returns the scalar (z‑axis) cross product of two 2‑D vectors
Normalize()Scales the vector to have a length of one
CompareTo(other: Vector2)Compares this vector with another, typically by length or component order

See Also