---
name: "vector_length"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/vector_length"
---

# vector\_length(3alleg)

Calculates the length of a vector. Allegro game programming library.

## NAME

vector\_length, vector\_length\_f - Calculates the length of a vector. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**fixed vector\_length(fixed x, fixed y, fixed z);**

**float vector\_length\_f(float x, float y, float z);**

## DESCRIPTION

Calculates the length of the vector (x, y, z), using that good 'ole  Pythagoras theorem.

## SEE ALSO

[**normalize\_vector**(3alleg)](/normalize_vector/3alleg.md)
