Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

VRageMath.Vector2D

Morten Aune Lyrstad edited this page Apr 16, 2022 · 52 revisions

IndexNamespace Index

Vector2D Struct

public struct Vector2D: IEquatable<Vector2D>

Defines a vector with two components.

Namespace: VRageMath
Assembly: VRage.Math.dll

Implements:

Fields

Member Description
static Vector2D One
static Vector2D PositiveInfinity
static Vector2D UnitX
static Vector2D UnitY
static Vector2D Zero
double X Gets or sets the x-component of the vector.
double Y Gets or sets the y-component of the vector.

Properties

Member Description
double Item { get; set; }

Constructors

Member Description
Vector2D(double, double)
Vector2D(double)

Methods

Member Description
static Vector2D Add(Vector2D, Vector2D) Adds two vectors.
static void Add(ref Vector2D, ref Vector2D, out Vector2D) Adds two vectors.
static Vector2D Barycentric(Vector2D, Vector2D, Vector2D, double, double) Returns a Vector2D containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
static void Barycentric(ref Vector2D, ref Vector2D, ref Vector2D, double, double, out Vector2D) Returns a Vector2D containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
static Vector2D CatmullRom(Vector2D, Vector2D, Vector2D, Vector2D, double) Performs a Catmull-Rom interpolation using the specified positions.
static void CatmullRom(ref Vector2D, ref Vector2D, ref Vector2D, ref Vector2D, double, out Vector2D) Performs a Catmull-Rom interpolation using the specified positions.
static Vector2D Clamp(Vector2D, Vector2D, Vector2D) Restricts a value to be within a specified range.
static void Clamp(ref Vector2D, ref Vector2D, ref Vector2D, out Vector2D) Restricts a value to be within a specified range.
static Vector2D ClampToSphere(Vector2D, double)
static void ClampToSphere(ref Vector2D, double)
static double Distance(Vector2D, Vector2D) Calculates the distance between two vectors.
static void Distance(ref Vector2D, ref Vector2D, out double) Calculates the distance between two vectors.
static double DistanceSquared(Vector2D, Vector2D) Calculates the distance between two vectors squared.
static void DistanceSquared(ref Vector2D, ref Vector2D, out double) Calculates the distance between two vectors squared.
static Vector2D Divide(Vector2D, Vector2D) Divides the components of a vector by the components of another vector.
static void Divide(ref Vector2D, ref Vector2D, out Vector2D) Divides the components of a vector by the components of another vector.
static Vector2D Divide(Vector2D, double) Divides a vector by a scalar value.
static void Divide(ref Vector2D, double, out Vector2D) Divides a vector by a scalar value.
static double Dot(Vector2D, Vector2D) Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a doubleing point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
static void Dot(ref Vector2D, ref Vector2D, out double) Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a doubleing point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
static Vector2D Floor(Vector2D)
static Vector2D Hermite(Vector2D, Vector2D, Vector2D, Vector2D, double) Performs a Hermite spline interpolation.
static void Hermite(ref Vector2D, ref Vector2D, ref Vector2D, ref Vector2D, double, out Vector2D) Performs a Hermite spline interpolation.
static Vector2D Lerp(Vector2D, Vector2D, double) Performs a linear interpolation between two vectors.
static void Lerp(ref Vector2D, ref Vector2D, double, out Vector2D) Performs a linear interpolation between two vectors.
static Vector2D Max(Vector2D, Vector2D) Returns a vector that contains the highest value from each matching pair of components.
static void Max(ref Vector2D, ref Vector2D, out Vector2D) Returns a vector that contains the highest value from each matching pair of components.
static Vector2D Min(Vector2D, Vector2D) Returns a vector that contains the lowest value from each matching pair of components.
static void Min(ref Vector2D, ref Vector2D, out Vector2D) Returns a vector that contains the lowest value from each matching pair of components.
static Vector2D Multiply(Vector2D, Vector2D) Multiplies the components of two vectors by each other.
static void Multiply(ref Vector2D, ref Vector2D, out Vector2D) Multiplies the components of two vectors by each other.
static Vector2D Multiply(Vector2D, double) Multiplies a vector by a scalar value.
static void Multiply(ref Vector2D, double, out Vector2D) Multiplies a vector by a scalar value.
static Vector2D Negate(Vector2D) Returns a vector pointing in the opposite direction.
static void Negate(ref Vector2D, out Vector2D) Returns a vector pointing in the opposite direction.
static Vector2D Normalize(Vector2D) Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
static void Normalize(ref Vector2D, out Vector2D) Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.
static Vector2D Reflect(Vector2D, Vector2D) Determines the reflect vector of the given vector and normal.
static void Reflect(ref Vector2D, ref Vector2D, out Vector2D) Determines the reflect vector of the given vector and normal.
static Vector2D SmoothStep(Vector2D, Vector2D, double) Interpolates between two values using a cubic equation.
static void SmoothStep(ref Vector2D, ref Vector2D, double, out Vector2D) Interpolates between two values using a cubic equation.
static Vector2D Subtract(Vector2D, Vector2D) Subtracts a vector from a vector.
static void Subtract(ref Vector2D, ref Vector2D, out Vector2D) Subtracts a vector from a vector.
static Vector2D Transform(Vector2D, Matrix) Transforms the vector (x, y, 0, 1) by the specified matrix.
static void Transform(ref Vector2D, ref Matrix, out Vector2D) Transforms a Vector2D by the given Matrix.
static Vector2D Transform(Vector2D, Quaternion) Transforms a single Vector2D, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.
static void Transform(ref Vector2D, ref Quaternion, out Vector2D) Transforms a Vector2D, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.
static void Transform(Vector2D[], ref Matrix, Vector2D[]) Transforms an array of Vector2s by a specified Matrix.
static void Transform(Vector2D[], int, ref Matrix, Vector2D[], int, int) Transforms a specified range in an array of Vector2s by a specified Matrix and places the results in a specified range in a destination array.
static void Transform(Vector2D[], ref Quaternion, Vector2D[]) Transforms an array of Vector2s by a specified Quaternion.
static void Transform(Vector2D[], int, ref Quaternion, Vector2D[], int, int) Transforms a specified range in an array of Vector2s by a specified Quaternion and places the results in a specified range in a destination array.
static Vector2D TransformNormal(Vector2D, Matrix) Transforms a 2D vector normal by a matrix.
static void TransformNormal(ref Vector2D, ref Matrix, out Vector2D) Transforms a vector normal by a matrix.
static void TransformNormal(Vector2D[], ref Matrix, Vector2D[]) Transforms an array of Vector2D vector normals by a specified Matrix.
static void TransformNormal(Vector2D[], int, ref Matrix, Vector2D[], int, int) Transforms a specified range in an array of Vector2D vector normals by a specified Matrix and places the results in a specified range in a destination array.
void AssertIsValid()
bool Between(ref Vector2D, ref Vector2D)
bool Equals(Vector2D) Determines whether the specified Object is equal to the Vector2D.
bool Equals(object) Returns a value that indicates whether the current instance is equal to a specified object.
int GetHashCode() Gets the hash code of the vector object.
bool IsValid()
double Length() Calculates the length of the vector.
double LengthSquared() Calculates the length of the vector squared.
void Normalize() Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.
void Rotate(double)
string ToString() Retrieves a string representation of the current object.

Clone this wiki locally