Vector Structure

Defines a vector.

Definition

Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public readonly struct Vector : IEquatable<Vector>
Inheritance
Object    ValueType    Vector
Implements
IEquatableVector

Properties

Length Length of the vector.
One Returns the vector (1.0, 1.0).
SquaredLength Squared Length of the vector.
UnitX Returns the vector (1.0, 0.0).
UnitY Returns the vector (0.0, 1.0).
X Gets the X component.
Y Gets the Y component.
Zero Returns the vector (0.0, 0.0).

Methods

Abs Returns a vector whose elements are the absolute values of each of the specified vector's elements.
Add(Vector, Vector) Adds the second to the first vector
Clamp(Vector, Vector, Vector) Restricts a vector between a minimum and a maximum value.
Cross(Vector, Vector) Returns the cross product of two vectors.
Deconstruct(Double, Double) Deconstructs the vector into its X and Y components.
Distance(Vector, Vector) Computes the Euclidean distance between the two given points.
DistanceSquared(Vector, Vector) Returns the Euclidean distance squared between two specified points
Divide(Vector, Vector) Divides the first vector by the second.
Divide(Vector, Double) Divides the vector by the given scalar.
Dot(Vector, Vector) Returns the dot product of two vectors.
Equals(Object)
(Overrides ValueTypeEquals(Object))
Equals(Vector) Check if two vectors are equal (bitwise).
GetHashCode
(Overrides ValueTypeGetHashCode)
GetTypeGets the Type of the current instance.
(Inherited from Object)
Max(Vector, Vector) Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors
Min(Vector, Vector) Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors
Multiply(Vector, Vector) Multiplies the first vector by the second.
Multiply(Vector, Double) Multiplies the vector by the given scalar.
NearlyEquals(Vector) Check if two vectors are nearly equal (numerically).
Negate Returns a negated version of this vector.
Negate(Vector) Negates the vector
Normalize Returns a normalized version of this vector.
Normalize(Vector) Normalizes the given vector.
Parse(String) Parses a Vector string.
Subtract(Vector, Vector) Subtracts the second from the first vector
ToString Returns the string representation of the vector.
(Overrides ValueTypeToString)
WithX(Double) Returns a new vector with the specified X component.
WithY(Double) Returns a new vector with the specified Y component.

Operators

Addition(Vector, Vector) Adds two vectors.
Division(Vector, Double) Scales a vector.
Equality(Vector, Vector) 
(Vector to Point) Converts the Vector to a Point.
(Vector2 to Vector) 
Inequality(Vector, Vector) 
Multiply(Double, Vector) Scales a vector.
Multiply(Vector, Vector) Calculates the dot product of two vectors.
Multiply(Vector, Double) Scales a vector.
Subtraction(Vector, Vector) Subtracts two vectors.
UnaryNegation(Vector) Negates a vector.

Extension Methods

See Also