DirectX Math Documentation

Welcome to DirectX Math

The DirectXMath library provides a set of SIMD‑friendly types and functions for common 2‑, 3‑, and 4‑dimensional mathematical operations used in graphics, physics, and game development. It is optimized for modern CPUs and works across Windows platforms.

Read the Overview

Vector Types

Fixed‑size vectors (XMFLOAT2, XMFLOAT3, XMFLOAT4) and SIMD vectors (XMVECTOR). Includes operations for addition, dot product, cross product, normalization, and more.

Explore Vectors

Matrix Types

Row‑major and column‑major matrices (XMFLOAT3X3, XMFLOAT4X4) with functions for multiplication, inversion, transposition, and perspective/orthographic projection.

Explore Matrices

Quaternion Utilities

Represent rotations without gimbal lock. Includes quaternion creation, interpolation, conversion to/from matrices, and angular velocity calculations.

Explore Quaternions

Math Functions

Optimized implementations of trigonometric, exponential, and utility functions that operate on scalar and SIMD types.

Browse Functions

Code Samples

Ready‑to‑run examples demonstrating typical tasks such as building a view matrix, transforming vertices, and animating with quaternions.

View Samples

FAQ & Best Practices

Answers to common questions and guidelines for achieving maximum performance with DirectXMath.

Read FAQ