# [−][src]Crate directx_math

# DirectX Math for Rust

A pure rust translation of DirectXMath, a SIMD linear algebra library for use in games and graphics apps.

Most functions and structs are exported at the crate root. Modules are organized according
to the `C++`

reference documentation.

## Matrix multiplication order and memory layout

DirectXMath uses "row-major" matrices, row-vectors, and pre-multiplication. Handedness is determined by
which function version is used (`RH`

vs. `LH`

). Multiplication order is the same as transformation order.

**Row-major** multiplication order:

```
MVP = Model * View * Projection;
```

**Column-major** multiplication order:

```
MVP = Projection * View * Model;
```

When laid out in memory, the data elements `0`

through `15`

of a "row-major" matrix are in the
same order as an OpenGL "column-major" matrix. The translation components of a transformation
matrix occupy elements `12`

, `13`

, and `14`

.

For example, `XMMatrixTranslation`

`(12.0, 13.0, 14.0)`

results in the following `[f32; 16]`

:

```
[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 12.0, 13.0, 14.0, 1.0]
```

## Example

use directx_math::*; let eye = XMVectorSet(10.0, 10.0, 10.0, 0.0); let focus = XMVectorSet(0.0, 0.0, 0.0, 0.0); let up = XMVectorSet(0.0, 1.0, 0.0, 0.0); let view = XMMatrixLookAtRH(eye, focus, up); let fov_y = XMConvertToRadians(65.0); let aspect_ratio = 1024.0 / 768.0; let near_z = 0.1; let far_z = 1000.0; let projection = XMMatrixPerspectiveFovRH(fov_y, aspect_ratio, near_z, far_z); let model = XMMatrixIdentity(); let mvp = XMMatrixMultiply(XMMatrixMultiply(model, &view), &projection); // or use the unit struct with operator overloads let model = XMMatrix(model); let view = XMMatrix(view); let projection = XMMatrix(projection); // row-major multiplication order is the same as the transformation order assert_eq!(XMMatrix(mvp), model * view * projection);

## Modules

accessor | Vector accessors |

collision | Collision functions and bounding volumes |

conversion | Vector data conversion functions |

load | Vector and Matrix load functions |

matrix | Matrix functions |

plane | Plane functions |

quaternion | Quaternion functions |

scalar | Scalar functions |

store | Vector and Matrix store functions |

template | Vector manipulation functions |

utility | Utility and comparison functions |

vector | Vector functions usable on any vector type |

vector2d | 2D Vector functions |

vector3d | 3D Vector functions |

vector4d | 4D Vector functions |

## Structs

Align16 | |

XMFLOAT2 | |

XMFLOAT3 | |

XMFLOAT4 | |

XMFLOAT3X3 | |

XMFLOAT4X4 | |

XMINT2 | |

XMINT3 | |

XMINT4 | |

XMMatrix | Unit struct for |

XMUINT2 | |

XMUINT3 | |

XMUINT4 | |

XMVector | Unit struct for |

## Enums

Permute0X | |

Permute0Y | |

Permute0Z | |

Permute0W | |

Permute1X | |

Permute1Y | |

Permute1Z | |

Permute1W | |

SwizzleW | |

SwizzleX | |

SwizzleY | |

SwizzleZ |

## Constants

## Traits

Permute | XMVectorPermute trait parameters |

Swizzle | XMVectorSwizzle trait parameters |

XMVectorPermute | Permutes the components of two vectors to create a new vector. |

XMVectorSwizzle | Swizzles a vector |

## Functions

XMComparisonAllFalse | Tests the comparison value to determine if all of the compared components are false. |

XMComparisonAllInBounds | Tests the comparison value to determine if all of the compared components are within set bounds. |

XMComparisonAllTrue | Tests the comparison value to determine if all of the compared components are true. |

XMComparisonAnyFalse | Tests the comparison value to determine if any of the compared components are false. |

XMComparisonAnyOutOfBounds | Tests the comparison value to determine if any of the compared components are outside the set bounds. |

XMComparisonAnyTrue | Tests the comparison value to determine if any of the compared components are true. |

XMComparisonMixed | Tests the comparison value to determine if the compared components had mixed results--some true and some false. |

XMConvertToDegrees | Converts an angle measured in radians into one measured in degrees. |

XMConvertToRadians | Converts an angle measured in degrees into one measured in radians. |

XMConvertVectorFloatToInt | Converts an XMVECTOR with float components to an XMVECTOR with int32_t components and applies a uniform bias. |

XMConvertVectorFloatToUInt | Converts an XMVECTOR with uint32_t components to an XMVECTOR with float components and applies a uniform bias. |

XMConvertVectorIntToFloat | Converts an XMVECTOR with int32_t components to an XMVECTOR with float components and applies a uniform bias. |

XMConvertVectorUIntToFloat | Converts an XMVECTOR with uint32_t components to an XMVECTOR with float components and applies a uniform bias. |

XMFresnelTerm | Calculates the Fresnel term for unpolarized light. |

XMLoadFloat2 | Loads data into the x, y, and z components of an XMVECTOR, without type checking. |

XMLoadFloat3 | Loads an XMFLOAT3 into an XMVECTOR. |

XMLoadFloat3A | Loads an XMFLOAT3 into an aligned XMVECTOR. |

XMLoadFloat4 | Loads an XMFLOAT4 into an XMVECTOR. |

XMLoadFloat4A | Loads an XMFLOAT4 into an aligned XMVECTOR. |

XMLoadFloat3x3 | Loads an XMFLOAT3X3 into an MATRIX. |

XMLoadFloat4x4 | Loads an XMFLOAT4X4 into an XMMATRIX. |

XMLoadFloat4x4A | Loads an XMFLOAT4X4 into an aligned XMMATRIX. |

XMLoadInt2 | Loads data into the x and y components of an XMVECTOR. |

XMLoadInt3 | Loads data into the x, y, and z components of an XMVECTOR, without type checking. |

XMLoadInt4 | Loads data into an XMVECTOR, without type checking. |

XMMatrixAffineTransformation | Builds an affine transformation matrix. |

XMMatrixAffineTransformation2D | Builds a 2D affine transformation matrix in the xy plane. |

XMMatrixDecompose | Breaks down a general 3D transformation matrix into its scalar, rotational, and translational components. |

XMMatrixDeterminant | Computes the determinant of a matrix. |

XMMatrixIdentity | Builds the identity matrix. |

XMMatrixInverse | Computes the inverse of a matrix. |

XMMatrixIsIdentity | Tests whether a matrix is the identity matrix. |

XMMatrixIsInfinite | Tests whether any of the elements of a matrix are infinite. |

XMMatrixIsNaN | Tests whether any of the elements of a matrix are NaN. |

XMMatrixLookAtLH | Builds a view matrix for a left-handed coordinate system using a camera position, an up direction, and a focal point. |

XMMatrixLookAtRH | Builds a view matrix for a right-handed coordinate system using a camera position, an up direction, and a focal point. |

XMMatrixLookToLH | Builds a view matrix for a left-handed coordinate system using a camera position, an up direction, and a camera direction. |

XMMatrixLookToRH | Builds a view matrix for a right-handed coordinate system using a camera position, an up direction, and a camera direction. |

XMMatrixMultiply | Computes the product of two matrices. |

XMMatrixMultiplyTranspose | Computes the transpose of the product of two matrices. |

XMMatrixOrthographicLH | Builds an orthogonal projection matrix for a left-handed coordinate system. |

XMMatrixOrthographicRH | Builds an orthogonal projection matrix for a right-handed coordinate system. |

XMMatrixPerspectiveFovLH | Builds a left-handed perspective projection matrix based on a field of view. |

XMMatrixPerspectiveFovRH | Builds a right-handed perspective projection matrix based on a field of view. |

XMMatrixPerspectiveLH | Builds a left-handed perspective projection matrix. |

XMMatrixPerspectiveRH | Builds a right-handed perspective projection matrix. |

XMMatrixReflect | Builds a transformation matrix designed to reflect vectors through a given plane. |

XMMatrixRotationAxis | Builds a matrix that rotates around an arbitrary axis. |

XMMatrixRotationNormal | Builds a matrix that rotates around an arbitrary normal vector. |

XMMatrixRotationQuaternion | Builds a rotation matrix from a quaternion. |

XMMatrixRotationRollPitchYaw | Builds a rotation matrix based on a given |

XMMatrixRotationRollPitchYawFromVector | Builds a rotation matrix based on a vector containing the Euler angles ( |

XMMatrixRotationX | Builds a matrix that rotates around the |

XMMatrixRotationY | Builds a matrix that rotates around the |

XMMatrixRotationZ | Builds a matrix that rotates around the |

XMMatrixScaling | Builds a matrix that scales along the x-axis, y-axis, and z-axis. |

XMMatrixScalingFromVector | Builds a matrix that scales along the x-axis, y-axis, and z-axis. |

XMMatrixSet | Creates a matrix with float values. |

XMMatrixShadow | Builds a transformation matrix that flattens geometry into a plane. |

XMMatrixTransformation | Builds a transformation matrix. |

XMMatrixTransformation2D | Builds a 2D transformation matrix. |

XMMatrixTranslation | Builds a translation matrix from the specified offsets. |

XMMatrixTranslationFromVector | Builds a translation matrix from a vector. |

XMMatrixTranspose | Computes the transpose of a matrix. |

XMMatrixVectorTensorProduct | XMMatrixVectorTensorProduct |

XMMax | Compares two numeric data type instances, or two instances of an object
which supports an overload of |

XMMin | Compares two numeric data type instances, or two instances of an object
which supports an overload of |

XMPlaneDot | Calculates the dot product between an input plane and a 4D vector. |

XMPlaneDotCoord | Calculates the dot product between an input plane and a 3D vector. |

XMPlaneDotNormal | Calculates the dot product between the normal vector of a plane and a 3D vector. |

XMPlaneEqual | Determines if two planes are equal. |

XMPlaneFromPointNormal | Computes the equation of a plane constructed from a point in the plane and a normal vector. |

XMPlaneFromPoints | Computes the equation of a plane constructed from three points in the plane. |

XMPlaneIntersectLine | Finds the intersection between a plane and a line. |

XMPlaneIntersectPlane | Finds the intersection of two planes. |

XMPlaneIsInfinite | Tests whether any of the coefficients of a plane is positive or negative infinity. |

XMPlaneIsNaN | Tests whether any of the coefficients of a plane is a NaN. |

XMPlaneNearEqual | Determines whether two planes are nearly equal. |

XMPlaneNormalize | Normalizes the coefficients of a plane so that coefficients of x, y, and z form a unit normal vector. |

XMPlaneNormalizeEst | Estimates the coefficients of a plane so that coefficients of x, y, and z form a unit normal vector. |

XMPlaneNotEqual | Determines if two planes are equal. |

XMPlaneTransform | Transforms a plane by a given matrix. |

XMQuaternionBaryCentric | Returns a point in barycentric coordinates, using the specified quaternions. |

XMQuaternionBaryCentricV | Returns a point in barycentric coordinates, using the specified quaternions. |

XMQuaternionConjugate | Computes the conjugate of a quaternion. |

XMQuaternionDot | Computes the dot product of two quaternions. |

XMQuaternionEqual | Tests whether two quaternions are equal. |

XMQuaternionExp | Computes the exponential of a given pure quaternion. |

XMQuaternionIdentity | Returns the identity quaternion. |

XMQuaternionInverse | Computes the inverse of a quaternion. |

XMQuaternionIsIdentity | Tests whether a specific quaternion is the identity quaternion. |

XMQuaternionIsInfinite | Test whether any component of a quaternion is either positive or negative infinity. |

XMQuaternionIsNaN | Test whether any component of a quaternion is a NaN. |

XMQuaternionLength | Computes the magnitude of a quaternion. |

XMQuaternionLengthSq | Computes the square of the magnitude of a quaternion. |

XMQuaternionLn | Computes the natural logarithm of a given unit quaternion. |

XMQuaternionMultiply | Computes the product of two quaternions. |

XMQuaternionNormalize | Computes the normalized version of a quaternion. |

XMQuaternionNormalizeEst | Estimates the normalized version of a quaternion. |

XMQuaternionNotEqual | Tests whether two quaternions are not equal. |

XMQuaternionReciprocalLength | Computes the reciprocal of the magnitude of a quaternion. |

XMQuaternionRotationAxis | Computes a rotation quaternion about an axis. |

XMQuaternionRotationMatrix | Computes a rotation quaternion from a rotation matrix. |

XMQuaternionRotationNormal | Computes the rotation quaternion about a normal vector. |

XMQuaternionRotationRollPitchYaw | Computes a rotation quaternion based on the |

XMQuaternionRotationRollPitchYawFromVector | Computes a rotation quaternion based on a vector containing the Euler angles ( |

XMQuaternionSlerp | Interpolates between two unit quaternions, using spherical linear interpolation. |

XMQuaternionSlerpV | Interpolates between two unit quaternions, using spherical linear interpolation. |

XMQuaternionSquad | Interpolates between four unit quaternions, using spherical quadrangle interpolation. |

XMQuaternionSquadSetup | Provides addresses of setup control points for spherical quadrangle interpolation. |

XMQuaternionSquadV | Interpolates between four unit quaternions, using spherical quadrangle interpolation. |

XMQuaternionToAxisAngle | Computes an axis and angle of rotation about that axis for a given quaternion. |

XMScalarACos | Computes the arccosine of a floating-point number. |

XMScalarACosEst | Estimates the arccosine of a floating-point number. |

XMScalarASin | Computes the arcsine of a floating-point number. |

XMScalarASinEst | Estimates the arcsine of a floating-point number. |

XMScalarCos | Computes the cosine of a radian angle. |

XMScalarCosEst | Estimates the cosine of a radian angle. |

XMScalarModAngle | Computes an angle between |

XMScalarNearEqual | Determines if two floating-point values are nearly equal. |

XMScalarSin | Computes the sine of a radian angle. |

XMScalarSinCos | Computes both the sine and cosine of a radian angle. |

XMScalarSinCosEst | Estimates both the sine and cosine of a radian angle. |

XMScalarSinEst | Estimates the sine of a radian angle. |

XMStoreFloat | Stores an XMVECTOR in a float. |

XMStoreFloat2 | Stores an XMVECTOR in an XMFLOAT2. |

XMStoreFloat3 | Stores an XMVECTOR in an XMFLOAT3. |

XMStoreFloat3A | Stores an XMVECTOR in an aligned XMFLOAT3. |

XMStoreFloat4 | Stores an XMVECTOR in an XMFLOAT4. |

XMStoreFloat4A | Stores an XMVECTOR in an aligned XMFLOAT4. |

XMStoreFloat3x3 | Stores an XMMATRIX in an XMFLOAT3X3. |

XMStoreFloat4x4 | Stores an XMMATRIX in an XMFLOAT4X4. |

XMStoreFloat4x4A | Stores an XMMATRIX in an aligned XMFLOAT4X4. |

XMStoreInt2 | Stores an XMVECTOR in a 2-element uint32_t array. |

XMStoreInt3 | Stores an XMVECTOR in a 3-element uint32_t array. |

XMStoreInt4 | Stores an XMVECTOR in a 4-element uint32_t array. |

XMVector2Equal | Tests whether two 2D vectors are equal. |

XMVector2EqualR | Tests whether two 2D vectors are equal. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector2EqualInt | Tests whether two 2D vectors are equal, treating each component as an unsigned integer. |

XMVector2EqualIntR | Tests whether two 2D vectors are equal, treating each component as an unsigned integer. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector2NearEqual | Tests whether one 2D vector is near another 2D vector. |

XMVector2NotEqual | Tests whether two 2D vectors are not equal. |

XMVector2NotEqualInt | Test whether two vectors are not equal, treating each component as an unsigned integer. |

XMVector2Greater | Tests whether one 2D vector is greater than another 2D vector. |

XMVector2GreaterR | Tests whether one 2D vector is greater than another 2D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector2GreaterOrEqual | Tests whether one 2D vector is greater-than-or-equal-to another 2D vector. |

XMVector2GreaterOrEqualR | Tests whether one 2D vector is greater-than-or-equal-to another 2D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector2Less | Tests whether one 2D vector is less than another 2D vector. |

XMVector2LessOrEqual | Tests whether one 2D vector is less-than-or-equal-to another 2D vector. |

XMVector2InBounds | Tests whether the components of a 2D vector are within set bounds. |

XMVector2IsNaN | Tests whether any component of a 2D vector is a NaN. |

XMVector2IsInfinite | Tests whether any component of a 2D vector is positive or negative infinity. |

XMVector2Dot | Computes the dot product between 2D vectors. |

XMVector2Cross | Computes the 2D cross product. |

XMVector2LengthSq | Computes the square of the length of a 2D vector. |

XMVector2ReciprocalLengthEst | Estimates the reciprocal of the length of a 2D vector. |

XMVector2ReciprocalLength | Computes the reciprocal of the length of a 2D vector. |

XMVector2LengthEst | Estimates the length of a 2D vector. |

XMVector2Length | Computes the length of a 2D vector. |

XMVector2NormalizeEst | Estimates the normalized version of a 2D vector. |

XMVector2Normalize | Returns the normalized version of a 2D vector. |

XMVector2ClampLength | Clamps the length of a 2D vector to a given range. |

XMVector2ClampLengthV | Clamps the length of a 2D vector to a given range. |

XMVector2Reflect | Reflects an incident 2D vector across a 2D normal vector. |

XMVector2Refract | Refracts an incident 2D vector across a 2D normal vector. |

XMVector2RefractV | Refracts an incident 2D vector across a 2D normal vector. |

XMVector2Orthogonal | Computes a vector perpendicular to a 2D vector. |

XMVector2AngleBetweenNormalsEst | Estimates the radian angle between two normalized 2D vectors. |

XMVector2AngleBetweenNormals | Computes the radian angle between two normalized 2D vectors. |

XMVector2AngleBetweenVectors | Computes the radian angle between two 2D vectors. |

XMVector2LinePointDistance | Computes the minimum distance between a line and a point. |

XMVector2IntersectLine | Finds the intersection of two lines. |

XMVector2Transform | Transforms a 2D vector by a matrix. |

XMVector2TransformCoord | Transforms a 2D vector by a given matrix, projecting the result back into |

XMVector2TransformNormal | Transforms a 2D vector by a matrix. |

XMVector3Equal | Tests whether two 3D vectors are equal. |

XMVector3EqualR | Tests whether two 3D vectors are equal. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector3EqualInt | Tests whether two 3D vectors are equal, treating each component as an unsigned integer. |

XMVector3EqualIntR | Tests whether two 3D vectors are equal, treating each component as an unsigned integer. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector3NearEqual | Tests whether one 3D vector is near another 3D vector. |

XMVector3NotEqual | Tests whether two 3D vectors are not equal. |

XMVector3NotEqualInt | Test whether two 3D vectors are not equal, treating each component as an unsigned integer. |

XMVector3Greater | Tests whether one 3D vector is greater than another 3D vector. |

XMVector3GreaterR | Tests whether one 3D vector is greater than another 3D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector3GreaterOrEqual | Tests whether one 3D vector is greater-than-or-equal-to another 3D vector. |

XMVector3GreaterOrEqualR | Tests whether one 3D vector is greater-than-or-equal-to another 3D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector3Less | Tests whether one 3D vector is less than another 3D vector. |

XMVector3LessOrEqual | Tests whether one 3D vector is less than or equal to another 3D vector. |

XMVector3InBounds | Tests whether the components of a 3D vector are within set bounds. |

XMVector3IsNaN | Tests whether any component of a 3D vector is a NaN. |

XMVector3IsInfinite | Tests whether any component of a 3D vector is positive or negative infinity. |

XMVector3Dot | Computes the dot product between 3D vectors. |

XMVector3Cross | Computes the cross product between 3D vectors. |

XMVector3LengthSq | Computes the square of the length of a 3D vector. |

XMVector3ReciprocalLengthEst | Estimates the reciprocal of the length of a 3D vector. |

XMVector3ReciprocalLength | Computes the reciprocal of the length of a 3D vector. |

XMVector3LengthEst | Estimates the length of a 3D vector. |

XMVector3Length | Computes the length of a 3D vector. |

XMVector3NormalizeEst | Estimates the normalized version of a 3D vector. |

XMVector3Normalize | Returns the normalized version of a 3D vector. |

XMVector3ClampLength | Clamps the length of a 3D vector to a given range. |

XMVector3ClampLengthV | Clamps the length of a 3D vector to a given range. |

XMVector3Reflect | Reflects an incident 3D vector across a 3D normal vector. |

XMVector3Refract | Refracts an incident 3D vector across a 3D normal vector. |

XMVector3RefractV | Refracts an incident 3D vector across a 3D normal vector. |

XMVector3Orthogonal | Computes a vector perpendicular to a 3D vector. |

XMVector3AngleBetweenNormalsEst | Estimates the radian angle between two normalized 3D vectors. |

XMVector3AngleBetweenNormals | Computes the radian angle between two normalized 3D vectors. |

XMVector3AngleBetweenVectors | Computes the radian angle between two 3D vectors. |

XMVector3LinePointDistance | Computes the minimum distance between a line and a point. |

XMVector3ComponentsFromNormal | Using a reference normal vector, splits a 3D vector into components that are parallel and perpendicular to the normal. |

XMVector3Rotate | Rotates a 3D vector using a quaternion. |

XMVector3InverseRotate | Rotates a 3D vector using the inverse of a quaternion. |

XMVector3Transform | Transforms a 3D vector by a matrix. |

XMVector3TransformCoord | Transforms a 3D vector by a given matrix, projecting the result back into |

XMVector3TransformNormal | Transforms the 3D vector normal by the given matrix. |

XMVector3Project | Project a 3D vector from object space into screen space. |

XMVector3Unproject | Projects a 3D vector from screen space into object space. |

XMVector4Equal | Tests whether two 4D vectors are equal. |

XMVector4EqualR | Tests whether two 4D vectors are equal. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector4EqualInt | Tests whether two 4D vectors are equal, treating each component as an unsigned integer. |

XMVector4EqualIntR | Tests whether two 4D vectors are equal, treating each component as an unsigned integer. In addition, this function returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector4NearEqual | Tests whether one 4D vector is near another 4D vector. |

XMVector4NotEqual | Tests whether two 4D vectors are not equal. |

XMVector4NotEqualInt | Test whether two 4D vectors are not equal, treating each component as an unsigned integer. |

XMVector4Greater | Tests whether one 4D vector is greater than another 4D vector. |

XMVector4GreaterR | Tests whether one 4D vector is greater than another 4D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector4GreaterOrEqual | Tests whether one 4D vector is greater-than-or-equal-to another 4D vector. |

XMVector4GreaterOrEqualR | Tests whether one 4D vector is greater-than-or-equal-to another 4D vector and returns a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVector4Less | Tests whether one 4D vector is less than another 4D vector. |

XMVector4LessOrEqual | Tests whether one 4D vector is less than or equal to another 4D vector. |

XMVector4InBounds | Tests whether the components of a 4D vector are within set bounds. |

XMVector4IsNaN | Tests whether any component of a 4D vector is a NaN. |

XMVector4IsInfinite | Tests whether any component of a 4D vector is a NaN. |

XMVector4Dot | Computes the dot product between 4D vectors. |

XMVector4Cross | Computes the cross product between 4D vectors. |

XMVector4LengthSq | Computes the square of the length of a 4D vector. |

XMVector4ReciprocalLengthEst | Estimates the reciprocal of the length of a 4D vector. |

XMVector4ReciprocalLength | Computes the reciprocal of the length of a 4D vector. |

XMVector4LengthEst | Estimates the length of a 4D vector. |

XMVector4Length | Computes the length of a 4D vector. |

XMVector4NormalizeEst | Estimates the normalized version of a 4D vector. |

XMVector4Normalize | Computes the normalized version of a 4D vector. |

XMVector4ClampLength | Clamps the length of a 4D vector to a given range. |

XMVector4ClampLengthV | Clamps the length of a 4D vector to a given range. |

XMVector4Reflect | Reflects an incident 4D vector across a 4D normal vector. |

XMVector4Refract | Reflects an incident 4D vector across a 4D normal vector. |

XMVector4RefractV | Computes a vector perpendicular to a 4D vector. |

XMVector4Orthogonal | Computes a vector perpendicular to a 4D vector. |

XMVector4AngleBetweenNormalsEst | Estimates the radian angle between two normalized 4D vectors. |

XMVector4AngleBetweenNormals | Computes the radian angle between two normalized 4D vectors. |

XMVector4AngleBetweenVectors | Compute the radian angle between two 4D vectors. |

XMVector4Transform | Transforms a 4D vector by a matrix. |

XMVectorACos | Computes the arccosine of each component of an XMVECTOR. |

XMVectorACosEst | Estimates the arccosine of each component of an XMVECTOR. |

XMVectorASin | Computes the arcsine of each component of an XMVECTOR. |

XMVectorASinEst | Estimates the arcsine of each component of an XMVECTOR. |

XMVectorATan | Computes the arctangent of each component of an XMVECTOR. |

XMVectorATan2 | Computes the arctangent of Y/X. |

XMVectorATan2Est | Estimates the arctangent of Y/X. |

XMVectorATanEst | Estimates the arctangent of each component of an XMVECTOR. |

XMVectorAbs | Computes the absolute value of each component of an XMVECTOR. |

XMVectorAdd | Computes the sum of two vectors. |

XMVectorAddAngles | Adds two vectors representing angles. |

XMVectorAndCInt | Computes the logical AND of one vector with the negation of a second vector, treating each component as an unsigned integer. |

XMVectorAndInt | Computes the logical AND of two vectors, treating each component as an unsigned integer. |

XMVectorBaryCentric | Returns a point in Barycentric coordinates, using the specified position vectors. |

XMVectorBaryCentricV | Returns a point in Barycentric coordinates, using the specified position vectors. |

XMVectorCatmullRom | Performs a Catmull-Rom interpolation, using the specified position vectors. |

XMVectorCatmullRomV | Performs a Catmull-Rom interpolation, using the specified position vectors. |

XMVectorCeiling | Computes the ceiling of each component of an XMVECTOR. |

XMVectorClamp | Clamps the components of a vector to a specified minimum and maximum range. |

XMVectorCos | Computes the cosine of each component of an XMVECTOR. |

XMVectorCosEst | Estimates the cosine of each component of an XMVECTOR. |

XMVectorCosH | Computes the hyperbolic cosine of each component of an XMVECTOR. |

XMVectorDivide | Divides one instance of XMVECTOR by a second instance, returning the result in a third instance. |

XMVectorEqual | Performs a per-component test for equality of two vectors. |

XMVectorEqualInt | Performs a per-component test for the equality of two vectors, treating each component as an unsigned integer. |

XMVectorEqualIntR | Performs a per-component test for equality of two vectors, treating each component as an unsigned integer. In addition, this function sets a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVectorEqualR | Performs a per-component test for equality of two vectors and sets a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVectorExp | Computes two raised to the power for each component. |

XMVectorExp2 | Computes two raised to the power for each component. |

XMVectorFalseInt | Returns the zero (false) vector. |

XMVectorFloor | Computes the floor of each component of an XMVECTOR. |

XMVectorGetByIndex | Retrieve the value of one of the four components of an XMVECTOR Data Type containing floating-point data by index. |

XMVectorGetIntByIndex | Retrieve the value of one of the four components of an XMVECTOR Data Type containing integer data by index. |

XMVectorGetIntW | Retrieve the |

XMVectorGetIntX | Retrieve the |

XMVectorGetIntY | Retrieve the |

XMVectorGetIntZ | Retrieve the |

XMVectorGetW | Retrieve the |

XMVectorGetWPtr | Retrieve the |

XMVectorGetX | Retrieve the |

XMVectorGetXPtr | Retrieve the |

XMVectorGetY | Retrieve the |

XMVectorGetYPtr | Retrieve the |

XMVectorGetZ | Retrieve the |

XMVectorGetZPtr | Retrieve the |

XMVectorGreater | Performs a per-component test for greater-than between two vectors. |

XMVectorGreaterOrEqual | Performs a per-component test for greater-than-or-equal between two vectors. |

XMVectorGreaterOrEqualR | Performs a per-component test for greater-than-or-equal between two vectors and sets a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVectorGreaterR | Performs a per-component test for greater-than between two vectors and sets a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVectorHermite | Performs a Hermite spline interpolation, using the specified vectors. |

XMVectorHermiteV | Performs a Hermite spline interpolation, using the specified vectors. |

XMVectorInBounds | Tests whether the components of a given vector are within set bounds. |

XMVectorInBoundsR | Tests whether the components of a given vector are within certain bounds and sets a comparison value that can be examined using functions such as XMComparisonAllTrue. |

XMVectorInsert | Rotates a vector left by a given number of 32-bit components and insert selected elements of that result into another vector. |

XMVectorIsInfinite | Performs a per-component test for +/- infinity on a vector. |

XMVectorIsNaN | Performs a per-component NaN test on a vector. |

XMVectorLerp | Performs a linear interpolation between two vectors. |

XMVectorLerpV | Performs a linear interpolation between two vectors. |

XMVectorLess | Performs a per-component test for less-than between two vectors. |

XMVectorLessOrEqual | Performs a per-component test for less-than-or-equal between two vectors. |

XMVectorMax | Makes a per-component comparison between two vectors, and returns a vector containing the largest components. |

XMVectorMergeXY | Creates a new vector by combining the |

XMVectorMergeZW | Creates a new vector by combining the |

XMVectorMin | Makes a per-component comparison between two vectors, and returns a vector containing the smallest components. |

XMVectorMod | Computes the per-component floating-point remainder of the quotient of two vectors. |

XMVectorModAngles | Computes the per-component angle modulo 2PI. |

XMVectorMultiply | Computes the per-component product of two vectors. |

XMVectorMultiplyAdd | Computes the product of the first two vectors added to the third vector. |

XMVectorNearEqual | Performs a per-component test for equality of two vectors within a given threshold. |

XMVectorNegate | Computes the negation of a vector. |

XMVectorNegativeMultiplySubtract | Computes the difference of a third vector and the product of the first two vectors. |

XMVectorNorInt | Computes the logical NOR of two vectors, treating each component as an unsigned integer. |

XMVectorNotEqual | Performs a per-component test for the inequality of two vectors. |

XMVectorNotEqualInt | Performs a per-component test for the inequality of two vectors, treating each component as an unsigned integer. |

XMVectorOrInt | Computes the logical OR of two vectors, treating each component as an unsigned integer. |

XMVectorPermute | Permutes the components of two vectors to create a new vector. |

XMVectorPow | Computes V1 raised to the power of V2. |

XMVectorReciprocal | Estimates the per-component reciprocal of a vector. |

XMVectorReciprocalEst | Estimates the per-component reciprocal of a vector. |

XMVectorReciprocalSqrt | Computes the per-component reciprocal square root of a vector. |

XMVectorReciprocalSqrtEst | Estimates the per-component reciprocal square root of a vector. |

XMVectorReplicate | Replicates a floating-point value into all four components of a vector. |

XMVectorReplicateInt | Replicates an integer value into all four components of a vector. |

XMVectorReplicatePtr | Replicates a floating-point value referenced by pointer into all four components of a vector. |

XMVectorRotateLeft | Rotates the vector left by a given number of 32-bit elements. |

XMVectorRotateRight | Rotates the vector right by a given number of 32-bit elements. |

XMVectorRound | Rounds each component of a vector to the nearest even integer (known as "Bankers Rounding"). |

XMVectorSaturate | Saturates each component of a vector to the range 0.0f to 1.0f. |

XMVectorScale | Scalar multiplies a vector by a floating-point value. |

XMVectorSelect | Performs a per-component selection between two input vectors and returns the resulting vector. |

XMVectorSelectControl | Defines a control vector for use in XMVectorSelect. |

XMVectorSet | Creates a vector using four floating-point values. |

XMVectorSetBinaryConstant | Creates a vector, each of whose components is either |

XMVectorSetByIndex | Use a floating-point object to set the value of one of the four components of an XMVECTOR Data Type containing integer data referenced by an index. |

XMVectorSetInt | Creates a vector with unsigned integer components. |

XMVectorSetIntByIndex | Use an integer instance to set the value of one of the four components of an XMVECTOR Data Type containing integer data referenced by an index. |

XMVectorSetIntW | Set the value of the |

XMVectorSetIntX | Set the value of the |

XMVectorSetIntY | Set the value of the |

XMVectorSetIntZ | Set the value of the |

XMVectorSetW | Set the value of the |

XMVectorSetX | Set the value of the |

XMVectorSetY | Set the value of the |

XMVectorSetZ | Set the value of the |

XMVectorShiftLeft | Shifts a vector left by a given number of 32-bit elements, filling the vacated elements with elements from a second vector. |

XMVectorSin | Computes the sine of each component of an XMVECTOR. |

XMVectorSinCos | Computes the sine and cosine of each component of an XMVECTOR. |

XMVectorSinCosEst | Estimates the sine and cosine of each component of an XMVECTOR. |

XMVectorSinEst | Estimates the sine of each component of an XMVECTOR. |

XMVectorSinH | Computes the hyperbolic sine of each component of an XMVECTOR. |

XMVectorSplatConstant | Creates a vector with identical floating-point components. Each component is a constant divided by two raised to an integer exponent. |

XMVectorSplatConstantInt | Creates a vector with identical integer components. |

XMVectorSplatEpsilon | Returns a vector, each of whose components are epsilon ( |

XMVectorSplatInfinity | Returns a vector, each of whose components are infinity ( |

XMVectorSplatOne | Returns a vector, each of whose components are one. |

XMVectorSplatQNaN | Returns a vector, each of whose components are QNaN ( |

XMVectorSplatSignMask | Returns a vector, each of whose components are the sign mask ( |

XMVectorSplatW | Replicates the |

XMVectorSplatX | Replicates the |

XMVectorSplatY | Replicates the |

XMVectorSplatZ | Replicates the |

XMVectorSqrt | Computes the per-component square root of a vector. |

XMVectorSqrtEst | Estimates the per-component square root of a vector. |

XMVectorSubtract | Computes the difference of two vectors. |

XMVectorSubtractAngles | Subtracts two vectors representing angles. |

XMVectorSum | Computes the horizontal sum of the components of an XMVECTOR. The horizontal sum is the result of adding each component in the vector together. |

XMVectorSwizzle | Swizzles a vector. |

XMVectorTan | Computes the tangent of each component of an XMVECTOR. |

XMVectorTanEst | Estimates the tangent of each component of an XMVECTOR. |

XMVectorTanH | Computes the hyperbolic tangent of each component of an XMVECTOR. |

XMVectorTrueInt | Returns a vector, each of whose components represents true ( |

XMVectorTruncate | Rounds each component of a vector to the nearest integer value in the direction of zero. |

XMVectorXorInt | Computes the logical XOR of two vectors, treating each component as an unsigned integer. |

XMVectorZero | Creates the zero vector. |

## Type Definitions

## Unions

XMMATRIX | |

XMVECTORF32 | |

XMVECTORI32 | |

XMVECTORU8 | |

XMVECTORU32 |