dot_product(3alleg4)
β¨ NAME β¨
dot_product, dot_product_f β calculates the dot product, bestie π and yes it's part of the Allegro game programming library, so you know it's iconic.
π SYNOPSIS π
#include <allegro.h>
fixed dot_product(fixed x1, y1, z1, x2, y2, z2);
float dot_product_f(float x1, y1, z1, x2, y2, z2);
π DESCRIPTION π
okay so. this is the moment. dot_product calculates the dot product of (x1, y1, z1) and (x2, y2, z2) β like, literally that exact thing β and hands you back the result. that's it. that's the whole vibe. πΈ
it's giving "small function, big main character energy" fr fr. you feed it two vectors in 3D space, it does the math, and it returns the number. no drama, no side effects, just pure mathematical service. π¦
one version works in fixed point and the other one, dot_product_f, works in float. pick whichever matches the numbers you're already holding and go off. π
π SEE ALSO π
cross_product(3alleg4)β the other vector bestie, for when you need the perpendicular one π«Άnormalize_vector(3alleg4)β shrinks your vector down to unit length, so slay β¨exstars(3alleg4)β an example program, go peek at it π
lowkey reminder: everything above is exactly what the manual says, no cap. if you need the deets, they're all right here. π
this page came to you straight from the Allegro manual, version 4.4.3 β mwah, take care of her, she's a classic ππ«
π¦ 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