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 OverviewVector Types
Fixed‑size vectors (XMFLOAT2, XMFLOAT3, XMFLOAT4) and SIMD vectors (XMVECTOR). Includes operations for addition, dot product, cross product, normalization, and more.
Explore VectorsMatrix Types
Row‑major and column‑major matrices (XMFLOAT3X3, XMFLOAT4X4) with functions for multiplication, inversion, transposition, and perspective/orthographic projection.
Explore MatricesQuaternion Utilities
Represent rotations without gimbal lock. Includes quaternion creation, interpolation, conversion to/from matrices, and angular velocity calculations.
Explore QuaternionsMath Functions
Optimized implementations of trigonometric, exponential, and utility functions that operate on scalar and SIMD types.
Browse FunctionsCode Samples
Ready‑to‑run examples demonstrating typical tasks such as building a view matrix, transforming vertices, and animating with quaternions.
View SamplesFAQ & Best Practices
Answers to common questions and guidelines for achieving maximum performance with DirectXMath.
Read FAQ