---
title: "getRotation | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Function getRotation

-   getRotation(out: [quat](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.quat/), mat: [ReadonlyMat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ReadonlyMat4/)): [quat](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.quat/)[](#getrotation)
    
    Returns a quaternion representing the rotational component of a transformation matrix. If a matrix is built with fromRotationTranslation, the returned quaternion will be the same as the quaternion originally supplied.
    
    #### Parameters
    
    -   out: [quat](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.quat/)
        
        Quaternion to receive the rotation component
        
    -   mat: [ReadonlyMat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ReadonlyMat4/)
        
        Matrix to be decomposed (input)
        
    
    #### Returns [quat](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.quat/)
    
    out
