S3D_VECTOR_ANGLE(3)

πŸ’– s3d_vector_angle β€” the vibe is: how tilted are these two vectors at each other

okay bestie, welcome to the s3d Manual, page S3D_VECTOR_ANGLE(3) ✨ this one is short and sweet and it's literally just doing angle math for you, so let's go πŸ¦‹


✨ NAME ✨

s3d_vector_angle β€” calculate the angle between two vectors πŸŽ€


🌸 SYNOPSIS 🌸

#include <s3d.h>

float s3d_vector_angle(const float vector1[], const float vector2[]);

πŸ’… DESCRIPTION πŸ’…

so this function calculates and returns the angle between vector1 and vector2 β€” that's it, that's the whole job, and it ate πŸ‘‘

but listen, important caveat, no cap: the resulting angle is between 0 and PI, which means it does not cover the whole period! so don't come at it expecting a full 360 situation, because it's giving half-circle only 🫢

wanna turn that result into degrees? easy, just do result*180/M_PI and you're slaying in degrees instead of radians πŸ’–

also, all vectors should have the format float[3] β€” three floats, that's the shape, periodt.

more info on wikipedia btw, the link is right here, go be a nerd about it, i support it: http://en.wikipedia.org/wiki/Vector_(spatial) 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Simon Wunderlich Author of s3d πŸ’œ


and that's a wrap on this one, bestie! this page came from the s3d manual, S3D_VECTOR_ANGLE(3) β€” mwah, go calculate some angles πŸ’…βœ¨