dot_product(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– dot_product β€” the Allegro manual, but make it cute πŸ’–

okay bestie, so this is a page from the Allegro manual β€” that's the game programming library, iykyk β€” and today we're talking about the dot product. yes THE dot product. the little math baddie that carries half of your graphics code on its back. no cap.


✨ NAME ✨

dot_product, dot_product_f β€” calculates the dot product. Allegro game programming library.

periodt. that's the whole name section. two functions, one job, zero notes.


🌸 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);

not me showing you the include first because of course you need #include <allegro.h>, we're not animals πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically β€” Calculates the dot product (x1, y1, z1) . (x2, y2, z2), returning the result.

that's it. that's the description. you hand it two vectors, it hands you back a single number, and that number is doing SO much heavy lifting for you behind the scenes. it's giving main character energy in a supporting role. the math girlies ate.

also quick vibe check on the two flavours: there's dot_product, which takes fixed values, and dot_product_f, which takes float values. same energy, different types. pick the one that matches your data and keep it moving πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, bestie, they're the friend group. cross_product(3) is the chaotic one, normalize_vector(3) is the one who keeps everyone in check, and exstars(3) is the demo that shows it all off. obsessed. 🫢


lowkey important reminder: this is documented for Allegro version 4.4.3, and the page itself is dot_product(3). so if you're on a different version, double-check your flags and your types, because we do not guess at behaviour around here πŸ’€

okay that's the whole page, love you, go multiply some vectors, mwah πŸ˜­πŸŽ€πŸ’–

πŸ“¦ where this page comes from