# Vector3Vector3Vector3Vector3 Struct

## Definition

Represents a vector with three single-precision floating-point values.

``public value class Vector3 : IEquatable<System::Numerics::Vector3>, IFormattable``
``public struct Vector3 : IEquatable<System.Numerics.Vector3>, IFormattable``
``````type Vector3 = struct
interface IFormattable``````
``````Public Structure Vector3
Implements IEquatable(Of Vector3), IFormattable``````
Inheritance
Vector3Vector3Vector3Vector3
Implements

## Remarks

The Vector3 structure provides support for hardware acceleration.

For matrix transformations, the Vector2, Vector3, and Vector4 instances are represented as rows: a vector v is transformed by a matrix M with vM multiplication.

## Constructors

 Vector3(Single) Vector3(Single) Vector3(Single) Vector3(Single) Creates a new Vector3 object whose three elements have the same value. Vector3(Vector2, Single) Vector3(Vector2, Single) Vector3(Vector2, Single) Vector3(Vector2, Single) Creates a new Vector3 object from the specified Vector2 object and the specified value. Vector3(Single, Single, Single) Vector3(Single, Single, Single) Vector3(Single, Single, Single) Vector3(Single, Single, Single) Creates a vector whose elements have the specified values.

## Fields

 X X X X The X component of the vector. Y Y Y Y The Y component of the vector. Z Z Z Z The Z component of the vector.

## Properties

 One One One One Gets a vector whose 3 elements are equal to one. UnitX UnitX UnitX UnitX Gets the vector (1,0,0). UnitY UnitY UnitY UnitY Gets the vector (0,1,0). UnitZ UnitZ UnitZ UnitZ Gets the vector (0,0,1). Zero Zero Zero Zero Gets a vector whose 3 elements are equal to zero.

## Methods

 Abs(Vector3) Abs(Vector3) Abs(Vector3) Abs(Vector3) Returns a vector whose elements are the absolute values of each of the specified vector's elements. Add(Vector3, Vector3) Add(Vector3, Vector3) Add(Vector3, Vector3) Add(Vector3, Vector3) Adds two vectors together. Clamp(Vector3, Vector3, Vector3) Clamp(Vector3, Vector3, Vector3) Clamp(Vector3, Vector3, Vector3) Clamp(Vector3, Vector3, Vector3) Restricts a vector between a minimum and a maximum value. CopyTo(Single[]) CopyTo(Single[]) CopyTo(Single[]) CopyTo(Single[]) Copies the elements of the vector to a specified array. CopyTo(Single[], Int32) CopyTo(Single[], Int32) CopyTo(Single[], Int32) CopyTo(Single[], Int32) Copies the elements of the vector to a specified array starting at a specified index position. Cross(Vector3, Vector3) Cross(Vector3, Vector3) Cross(Vector3, Vector3) Cross(Vector3, Vector3) Computes the cross product of two vectors. Distance(Vector3, Vector3) Distance(Vector3, Vector3) Distance(Vector3, Vector3) Distance(Vector3, Vector3) Computes the Euclidean distance between the two given points. DistanceSquared(Vector3, Vector3) DistanceSquared(Vector3, Vector3) DistanceSquared(Vector3, Vector3) DistanceSquared(Vector3, Vector3) Returns the Euclidean distance squared between two specified points. Divide(Vector3, Single) Divide(Vector3, Single) Divide(Vector3, Single) Divide(Vector3, Single) Divides the specified vector by a specified scalar value. Divide(Vector3, Vector3) Divide(Vector3, Vector3) Divide(Vector3, Vector3) Divide(Vector3, Vector3) Divides the first vector by the second. Dot(Vector3, Vector3) Dot(Vector3, Vector3) Dot(Vector3, Vector3) Dot(Vector3, Vector3) Returns the dot product of two vectors. Equals(Vector3) Equals(Vector3) Equals(Vector3) Equals(Vector3) Returns a value that indicates whether this instance and another vector are equal. Equals(Object) Equals(Object) Equals(Object) Equals(Object) Returns a value that indicates whether this instance and a specified object are equal. GetHashCode() GetHashCode() GetHashCode() GetHashCode() Returns the hash code for this instance. Length() Length() Length() Length() Returns the length of this vector object. LengthSquared() LengthSquared() LengthSquared() LengthSquared() Returns the length of the vector squared. Lerp(Vector3, Vector3, Single) Lerp(Vector3, Vector3, Single) Lerp(Vector3, Vector3, Single) Lerp(Vector3, Vector3, Single) Performs a linear interpolation between two vectors based on the given weighting. Max(Vector3, Vector3) Max(Vector3, Vector3) Max(Vector3, Vector3) Max(Vector3, Vector3) Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. Min(Vector3, Vector3) Min(Vector3, Vector3) Min(Vector3, Vector3) Min(Vector3, Vector3) Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. Multiply(Single, Vector3) Multiply(Single, Vector3) Multiply(Single, Vector3) Multiply(Single, Vector3) Multiplies a scalar value by a specified vector. Multiply(Vector3, Vector3) Multiply(Vector3, Vector3) Multiply(Vector3, Vector3) Multiply(Vector3, Vector3) Returns a new vector whose values are the product of each pair of elements in two specified vectors. Multiply(Vector3, Single) Multiply(Vector3, Single) Multiply(Vector3, Single) Multiply(Vector3, Single) Multiplies a vector by a specified scalar. Negate(Vector3) Negate(Vector3) Negate(Vector3) Negate(Vector3) Negates a specified vector. Normalize(Vector3) Normalize(Vector3) Normalize(Vector3) Normalize(Vector3) Returns a vector with the same direction as the specified vector, but with a length of one. Reflect(Vector3, Vector3) Reflect(Vector3, Vector3) Reflect(Vector3, Vector3) Reflect(Vector3, Vector3) Returns the reflection of a vector off a surface that has the specified normal. SquareRoot(Vector3) SquareRoot(Vector3) SquareRoot(Vector3) SquareRoot(Vector3) Returns a vector whose elements are the square root of each of a specified vector's elements. Subtract(Vector3, Vector3) Subtract(Vector3, Vector3) Subtract(Vector3, Vector3) Subtract(Vector3, Vector3) Subtracts the second vector from the first. ToString() ToString() ToString() ToString() Returns the string representation of the current instance using default formatting. ToString(String) ToString(String) ToString(String) ToString(String) Returns the string representation of the current instance using the specified format string to format individual elements. ToString(String, IFormatProvider) ToString(String, IFormatProvider) ToString(String, IFormatProvider) ToString(String, IFormatProvider) Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. Transform(Vector3, Matrix4x4) Transform(Vector3, Matrix4x4) Transform(Vector3, Matrix4x4) Transform(Vector3, Matrix4x4) Transforms a vector by a specified 4x4 matrix. Transform(Vector3, Quaternion) Transform(Vector3, Quaternion) Transform(Vector3, Quaternion) Transform(Vector3, Quaternion) Transforms a vector by the specified Quaternion rotation value. TransformNormal(Vector3, Matrix4x4) TransformNormal(Vector3, Matrix4x4) TransformNormal(Vector3, Matrix4x4) TransformNormal(Vector3, Matrix4x4) Transforms a vector normal by the given 4x4 matrix.

## Operators

 Addition(Vector3, Vector3) Addition(Vector3, Vector3) Addition(Vector3, Vector3) Addition(Vector3, Vector3) Adds two vectors together. Division(Vector3, Vector3) Division(Vector3, Vector3) Division(Vector3, Vector3) Division(Vector3, Vector3) Divides the first vector by the second. Division(Vector3, Single) Division(Vector3, Single) Division(Vector3, Single) Division(Vector3, Single) Divides the specified vector by a specified scalar value. Equality(Vector3, Vector3) Equality(Vector3, Vector3) Equality(Vector3, Vector3) Equality(Vector3, Vector3) Returns a value that indicates whether each pair of elements in two specified vectors is equal. Inequality(Vector3, Vector3) Inequality(Vector3, Vector3) Inequality(Vector3, Vector3) Inequality(Vector3, Vector3) Returns a value that indicates whether two specified vectors are not equal. Multiply(Vector3, Vector3) Multiply(Vector3, Vector3) Multiply(Vector3, Vector3) Multiply(Vector3, Vector3) Returns a new vector whose values are the product of each pair of elements in two specified vectors. Multiply(Vector3, Single) Multiply(Vector3, Single) Multiply(Vector3, Single) Multiply(Vector3, Single) Multiples the specified vector by the specified scalar value. Multiply(Single, Vector3) Multiply(Single, Vector3) Multiply(Single, Vector3) Multiply(Single, Vector3) Multiples the scalar value by the specified vector. Subtraction(Vector3, Vector3) Subtraction(Vector3, Vector3) Subtraction(Vector3, Vector3) Subtraction(Vector3, Vector3) Subtracts the second vector from the first. UnaryNegation(Vector3) UnaryNegation(Vector3) UnaryNegation(Vector3) UnaryNegation(Vector3) Negates the specified vector.