vector_length(3alleg4)
π vector_length β bestie, it's math time β¨
okay so you're in the Allegro game programming library, and you need to know how long a vector is. That's it. That's the whole page. And honestly? Iconic. π
This is the 3alleg4 manual, so pull up a chair (or a beanbag, whatever your setup is π¦) and let's get into it.
πΈ SYNOPSIS πΈ
#include <allegro.h>
fixed vector_length(fixed x, fixed y, fixed z);
float vector_length_f(float x, float y, float z);
Two functions, two vibes: one for the fixed girlies, one for the float girlies. Pick your fighter. π
β¨ DESCRIPTION β¨
Calculates the length of the vector (x, y, z), using that good 'ole Pythagoras theorem. πβ¨
Likeβ¦ yes bestie, the triangle guy. He came through. The length of the vector (x, y, z) β that's the distance from the origin all the way out to your point, no cap. π
Not me being emotionally attached to a square root. π It's giving main character energy fr fr.
π«Ά SEE ALSO π«Ά
normalize_vector(3alleg4)β because once you know the length, you're gonna wanna divide by it. iykyk π
version 4.4.3, courtesy of the Allegro manual (that's 3alleg4, in case you lost the plot π). That's the whole page bestie, go forth and slay your vectors. π§ππ
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms