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

-   squaredLength(a: [ReadonlyVec4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ReadonlyVec4/)): number[](#squaredlength)
    
    Calculates the squared length of a vec4
    
    #### Parameters
    
    -   a: [ReadonlyVec4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ReadonlyVec4/)
        
        vector to calculate squared length of
        
    
    #### Returns number
    
    squared length of a
