---
name: "normalize_vector"
section: "3alleg4"
platform: "linux"
package: "allegro4-doc"
version: "2:4.4.3.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/normalize_vector/3alleg4"
---

# normalize\_vector(3alleg4)

Converts the vector to a unit vector. Allegro game programming library.

## NAME

normalize\_vector, normalize\_vector\_f - Converts the vector to a unit vector. Allegro game programming library.

## SYNOPSIS

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

**void normalize\_vector(fixed \*x, fixed \*y, fixed \*z);**

**void normalize\_vector\_f(float \*x, float \*y, float \*z);**

## DESCRIPTION

Converts the vector (\*x, \*y, \*z) to a unit vector. This points in the  same direction as the original vector, but has a length of one.

## SEE ALSO

**vector\_length**(3alleg4), **dot\_product**(3alleg4), **cross\_product**(3alleg4), **exstars**(3alleg4)
