---
title: "fromZRotation | 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 fromZRotation

-   fromZRotation(out: [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/), rad: number): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)[](#fromzrotation)
    
    Creates a matrix from the given angle around the Z axis This is equivalent to (but much faster than):
    
    ```typescript
    mat4.identity(dest);
    mat4.rotateZ(dest, dest, rad);
    ```
    
    #### Parameters
    
    -   out: [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
        
        mat4 receiving operation result
        
    -   rad: number
        
        the angle to rotate the matrix by
        
    
    #### Returns [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    
    out
