Vector2 Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a 2D vector using two single-precision floating-point numbers.
[System.Serializable]
public struct Vector2 : IEquatable<OpenTK.Vector2>
type Vector2 = struct
- Inheritance
-
Vector2
- Attributes
- Implements
Remarks
The Vector2 structure is suitable for interoperation with unmanaged code requiring two consecutive floats.
Constructors
Vector2(Single, Single) |
Constructs a new Vector2. |
Vector2(Single) | |
Vector2(Vector2) |
Obsolete.
Constructs a new Vector2 from the given Vector2. |
Vector2(Vector3) |
Obsolete.
Constructs a new Vector2 from the given Vector3. |
Vector2(Vector4) |
Obsolete.
Constructs a new Vector2 from the given Vector4. |
Fields
One |
Defines an instance with all components set to 1. |
SizeInBytes |
Defines the size of the Vector2 struct in bytes. |
UnitX |
Defines a unit-length Vector2 that points towards the X-axis. |
UnitY |
Defines a unit-length Vector2 that points towards the Y-axis. |
X |
The X component of the Vector2. |
Y |
The Y component of the Vector2. |
Zero |
Defines a zero-length Vector2. |
Properties
Length |
Gets the length (magnitude) of the vector. |
LengthFast |
Gets an approximation of the vector length (magnitude). |
LengthSquared |
Gets the square of the vector length (magnitude). |
PerpendicularLeft |
Gets the perpendicular vector on the left side of this vector. |
PerpendicularRight |
Gets the perpendicular vector on the right side of this vector. |
Methods
Operators
Addition(Vector2, Vector2) | |
Division(Vector2, Single) | |
Equality(Vector2, Vector2) |
Compares the specified instances for equality. |
Inequality(Vector2, Vector2) |
Compares the specified instances for inequality. |
Multiply(Single, Vector2) | |
Multiply(Vector2, Single) | |
Subtraction(Vector2, Vector2) | |
UnaryNegation(Vector2) |