---
name: "normalize_vector"
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/normalize_vector"
---

# normalize\_vector(3alleg)

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**(3alleg)](/vector_length/3alleg.md), [**dot\_product**(3alleg)](/dot_product/3alleg.md), [**cross\_product**(3alleg)](/cross_product/3alleg.md), [**exstars**(3alleg)](/exstars/3alleg.md)
