Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
RotationMatrix
  • See Also
    • RotationTransform
    • EulerMatrix
    • RollPitchYawMatrix
    • Rotate
    • Dot
    • UnitVector
    • Sin
    • ReflectionMatrix
    • ScalingMatrix
    • PauliMatrix
    • OrthogonalMatrix
    • UnitaryMatrix
    • AnglePath3D
  • Related Guides
    • Geometric Transforms
    • Constructing Matrices
    • Matrices and Linear Algebra
    • Structured Arrays
    • Angles and Polar Coordinates
  • Workflows
    • Rotate, Pan and Zoom 3D Graphics
  • Tech Notes
    • Constructing Matrices
    • See Also
      • RotationTransform
      • EulerMatrix
      • RollPitchYawMatrix
      • Rotate
      • Dot
      • UnitVector
      • Sin
      • ReflectionMatrix
      • ScalingMatrix
      • PauliMatrix
      • OrthogonalMatrix
      • UnitaryMatrix
      • AnglePath3D
    • Related Guides
      • Geometric Transforms
      • Constructing Matrices
      • Matrices and Linear Algebra
      • Structured Arrays
      • Angles and Polar Coordinates
    • Workflows
      • Rotate, Pan and Zoom 3D Graphics
    • Tech Notes
      • Constructing Matrices

RotationMatrix[θ]

gives the 2D rotation matrix that rotates 2D vectors counterclockwise by θ radians.

RotationMatrix[θ,w]

gives the 3D rotation matrix for a counterclockwise rotation around the 3D vector w.

RotationMatrix[{u,v}]

gives the matrix that rotates the vector u to the direction of the vector v in any dimension.

RotationMatrix[θ,{u,v}]

gives the matrix that rotates by θ radians in the plane spanned by u and v.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Options  
TargetStructure  
Applications  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Tech Notes
Related Guides
Related Workflows
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • RotationTransform
    • EulerMatrix
    • RollPitchYawMatrix
    • Rotate
    • Dot
    • UnitVector
    • Sin
    • ReflectionMatrix
    • ScalingMatrix
    • PauliMatrix
    • OrthogonalMatrix
    • UnitaryMatrix
    • AnglePath3D
  • Related Guides
    • Geometric Transforms
    • Constructing Matrices
    • Matrices and Linear Algebra
    • Structured Arrays
    • Angles and Polar Coordinates
  • Workflows
    • Rotate, Pan and Zoom 3D Graphics
  • Tech Notes
    • Constructing Matrices
    • See Also
      • RotationTransform
      • EulerMatrix
      • RollPitchYawMatrix
      • Rotate
      • Dot
      • UnitVector
      • Sin
      • ReflectionMatrix
      • ScalingMatrix
      • PauliMatrix
      • OrthogonalMatrix
      • UnitaryMatrix
      • AnglePath3D
    • Related Guides
      • Geometric Transforms
      • Constructing Matrices
      • Matrices and Linear Algebra
      • Structured Arrays
      • Angles and Polar Coordinates
    • Workflows
      • Rotate, Pan and Zoom 3D Graphics
    • Tech Notes
      • Constructing Matrices

RotationMatrix

RotationMatrix[θ]

gives the 2D rotation matrix that rotates 2D vectors counterclockwise by θ radians.

RotationMatrix[θ,w]

gives the 3D rotation matrix for a counterclockwise rotation around the 3D vector w.

RotationMatrix[{u,v}]

gives the matrix that rotates the vector u to the direction of the vector v in any dimension.

RotationMatrix[θ,{u,v}]

gives the matrix that rotates by θ radians in the plane spanned by u and v.

Details and Options

  • RotationMatrix gives matrices for rotations of vectors around the origin.
  • Two different conventions for rotation matrices are in common use.
  • RotationMatrix is set up to use the vector-oriented convention and to give a matrix m so that m.r yields the rotated version of a vector r.
  • Transpose[RotationMatrix[…]] gives rotation matrices with the alternative coordinate-system-oriented convention for which r.m yields the rotated version of a vector r.
  • Angles in RotationMatrix are in radians. θ Degree or θ° specifies an angle in degrees.
  • Positive θ in RotationMatrix[θ,{u,v}] corresponds to going from the direction of u towards the direction of v.
  • RotationMatrix[θ] is equivalent to RotationMatrix[θ,{{1,0},{0,1}}].
  • RotationMatrix[θ,w] is equivalent to RotationMatrix[θ,{u,v}], where u⊥w, v⊥w, and u,v,w form a right-handed coordinate system.
  • RotationMatrix gives an orthogonal matrix of determinant 1, that in dimensions can be considered an element of the group .
  • RotationMatrix supports the option TargetStructure, which specifies the structure of the returned matrix. Possible settings for TargetStructure include:
  • Automaticautomatically choose the representation returned
    "Dense"represent the matrix as a dense matrix
    "Orthogonal"represent the matrix as an orthogonal matrix
    "Unitary"represent the matrix as a unitary matrix
  • RotationMatrix[…,TargetStructureAutomatic] is equivalent to RotationMatrix[…,TargetStructure"Dense"].

Examples

open all close all

Basic Examples  (4)

General 2D rotation matrix for rotating a vector about the origin:

Apply rotation by to a unit vector in the direction:

Counterclockwise rotation by 30°:

Rotation that transforms the direction of {1,1} into the direction of {0,–1}:

3D rotation around the axis:

Scope  (6)

A 4D rotation matrix, rotating in the plane:

A general 3D rotation matrix, rotating in the plane given by t{1,1,1} + s{1,–2,1}:

Rotate the vector {1,0,0} to the vector {0,0,1}:

Generate the rotation matrix for symbolic vectors, assuming that all quantities are real:

Rotating {0,0,1} gives the normalized {x,y,z} vector:

Transformation applied to a 2D shape:

Transformation applied to a 3D shape:

Options  (1)

TargetStructure  (1)

Return the rotation matrix as a dense matrix:

Return the rotation matrix as an orthogonal matrix:

Return the rotation matrix as a unitary matrix:

Applications  (2)

Rotating 3D shapes:

Produce a basis for all rotations in dimension :

All rotations in 2D:

All rotations in 3D:

All rotations in 4D; in general basis elements are needed for dimension :

Properties & Relations  (9)

A rotation matrix is orthogonal, i.e. the inverse is equal to the transpose:

In the complex case, the rotation matrix is unitary:

A rotation matrix has determinant :

Multiplying by the rotation matrix preserves the norm of a vector:

The inverse of RotationMatrix[θ,{u,v}] is given by RotationMatrix[-θ,{u,v}]:

The inverse of RotationMatrix[θ,{u,v}] is also given by RotationMatrix[θ,{v,u}]:

If u or v is not real the relationship is more complex:

In 2D the inverse of RotationMatrix[θ] is given by RotationMatrix[-θ]:

In 3D the inverse of RotationMatrix[θ,w] is given by RotationMatrix[θ,-w]:

If w is not real the relationship is more complex:

The composition of rotations is a rotation:

Possible Issues  (1)

The order in which rotations are performed is important:

Rotating around and then is not the same as first rotating around and then :

Neat Examples  (1)

Rotations of a circular sector:

See Also

RotationTransform  EulerMatrix  RollPitchYawMatrix  Rotate  Dot  UnitVector  Sin  ReflectionMatrix  ScalingMatrix  PauliMatrix  OrthogonalMatrix  UnitaryMatrix  AnglePath3D

Function Repository: RotationMatrixToQuaternion  QuaternionToRotationMatrix  AxisAngle  RandomRotationQuaternion

Tech Notes

    ▪
  • Constructing Matrices

Related Guides

    ▪
  • Geometric Transforms
  • ▪
  • Constructing Matrices
  • ▪
  • Matrices and Linear Algebra
  • ▪
  • Structured Arrays
  • ▪
  • Angles and Polar Coordinates

Related Workflows

    Related Workflows
    ▪
  • Rotate, Pan and Zoom 3D Graphics

History

Introduced in 2007 (6.0) | Updated in 2024 (14.0)

Wolfram Research (2007), RotationMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/RotationMatrix.html (updated 2024).

Text

Wolfram Research (2007), RotationMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/RotationMatrix.html (updated 2024).

CMS

Wolfram Language. 2007. "RotationMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/RotationMatrix.html.

APA

Wolfram Language. (2007). RotationMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RotationMatrix.html

BibTeX

@misc{reference.wolfram_2025_rotationmatrix, author="Wolfram Research", title="{RotationMatrix}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/RotationMatrix.html}", note=[Accessed: 01-March-2026]}

BibLaTeX

@online{reference.wolfram_2025_rotationmatrix, organization={Wolfram Research}, title={RotationMatrix}, year={2024}, url={https://reference.wolfram.com/language/ref/RotationMatrix.html}, note=[Accessed: 01-March-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English