[]
        
(Showing Draft Content)

C1.Util.DX.Vector2

Vector2 Struct

Represents a two dimensional mathematical vector.

Namespace: C1.Util.DX
Assembly: C1.Win.C1DX.4.8.dll
Syntax
[TypeConverter(typeof(Vector2Converter))]
public struct Vector2 : IEquatable<Vector2>, IFormattable

Constructors

Name Description
Vector2(float)

Initializes a new instance of the Vector2 struct.

Vector2(float, float)

Initializes a new instance of the Vector2 struct.

Vector2(float[])

Initializes a new instance of the Vector2 struct.

Fields

Name Description
One

A Vector2 with all of its components set to one.

SizeInBytes

The size of the Vector2 type, in bytes.

UnitX

The X unit Vector2 (1, 0).

UnitY

The Y unit Vector2 (0, 1).

X

The X component of the vector.

Y

The Y component of the vector.

Zero

A Vector2 with all of its components set to zero.

Properties

Name Description
IsNormalized

Gets a value indicting whether this instance is normalized.

this[int]

Gets or sets the component at the specified index.

Length

Gets the length of the vector.

LengthSquared

Gets the squared length of the vector.

Methods

Name Description
Abs(Vector2)

Returns a vector whose elements are the absolute values of each of the specified vector's elements.

AbsRef(ref Vector2)

Calculates the absolute value vector.

AbsRef(out Vector2, ref Vector2)

Returns a vector whose elements are the absolute values of each of the specified vector's elements.

Add(Vector2, Vector2)

Adds two vectors.

AddRef(out Vector2, ref Vector2, ref Vector2)

Adds two vectors.

AngleBetween(Vector2, Vector2)

Calculates an angle between two vectors, in radians.

Clamp(Vector2, Vector2, Vector2)

Restricts a vector between a minimum and a maximum value.

ClampRef(out Vector2, ref Vector2, ref Vector2, ref Vector2)

Restricts a vector between a minimum and a maximum value.

Divide(Vector2, Vector2)

Divides the first vector by the second.

Divide(Vector2, float)

Divides the specified vector by a specified scalar value.

DivideRef(out Vector2, ref Vector2, ref Vector2)

Divides the first vector by the second.

DivideRef(out Vector2, ref Vector2, float)

Divides the specified vector by a specified scalar value.

Dot(Vector2, Vector2)

Calculates the dot product of two vectors.

DotRef(ref Vector2, ref Vector2)

Calculates the dot product of two vectors.

Equals(Vector2)

Determines whether the specified Vector2 is equal to this instance.

Equals(object)

Determines whether the specified object is equal to this instance.

EqualsRef(ref Vector2)

Determines whether the specified Vector2 is equal to this instance.

GetHashCode()

Returns a hash code for this instance.

Lerp(Vector2, Vector2, float)

Performs a linear interpolation between two vectors based on the given weighting.

LerpRef(out Vector2, ref Vector2, ref Vector2, float)

Performs a linear interpolation between two vectors based on the given weighting.

Max(Vector2, Vector2)

Returns a vector containing the largest components of the specified vectors.

MaxRef(out Vector2, ref Vector2, ref Vector2)

Returns a vector containing the largest components of the specified vectors.

Min(Vector2, Vector2)

Returns a vector containing the smallest components of the specified vectors.

MinRef(out Vector2, ref Vector2, ref Vector2)

Returns a vector containing the smallest components of the specified vectors.

Multiply(Vector2, Vector2)

Modulates a vector with another by performing component-wise multiplication.

Multiply(Vector2, float)

Scales a vector by the given value.

MultiplyRef(out Vector2, ref Vector2, ref Vector2)

Modulates a vector with another by performing component-wise multiplication.

MultiplyRef(out Vector2, ref Vector2, float)

Scales a vector by the given value.

Negate(Vector2)

Reverses the direction of a given vector.

NegateRef(ref Vector2)

Reverses the direction of the vector.

NegateRef(out Vector2, ref Vector2)

Reverses the direction of a given vector.

Normalize(Vector2)

Converts the vector into a unit vector.

NormalizeRef(ref Vector2)

Converts the vector into a unit vector.

NormalizeRef(out Vector2, ref Vector2)

Converts the vector into a unit vector.

Subtract(Vector2, Vector2)

Subtracts two vectors.

SubtractRef(out Vector2, ref Vector2, ref Vector2)

Subtracts two vectors.

ToArray()

Creates an array containing the elements of the vector.

ToString()

Returns a string that represents this instance.

ToString(IFormatProvider)

Returns a string that represents this instance.

ToString(string)

Returns a string that represents this instance.

ToString(string, IFormatProvider)

Returns a string that represents this instance.

Operators

Name Description
operator +(Vector2, Point2F)

Adds the vector to the point.

operator +(Vector2, Vector2)

Adds two vectors.

operator /(Vector2, Vector2)

Divides the first vector by the second.

operator /(Vector2, float)

Divides the specified vector by a specified scalar value.

operator ==(Vector2, Vector2)

Tests for equality between two objects.

explicit operator Vector3(Vector2)

Performs an explicit conversion from Vector2 to Vector3.

explicit operator Vector4(Vector2)

Performs an explicit conversion from Vector2 to Vector4.

operator !=(Vector2, Vector2)

Tests for inequality between two objects.

operator *(Vector2, Vector2)

Modulates a vector with another by performing component-wise multiplication.

operator *(Vector2, float)

Scales a vector by the given value.

operator *(float, Vector2)

Scales a vector by the given value.

operator -(Vector2, Vector2)

Subtracts two vectors.

operator -(Vector2)

Reverses the direction of a given vector.