opengl_learn

Step-by-step introduction to OpenGL
git clone https://0xdd.org/code/opengl_learn.git
Log | Files | Refs | README | LICENSE

ogl_vec3f_magnitude.c (317B)


      1 /*
      2 2018 David DiPaola
      3 licensed under CC0 (public domain, see https://creativecommons.org/publicdomain/zero/1.0/)
      4 */
      5 
      6 #include <GL/glew.h>
      7 
      8 #include <math.h>
      9 
     10 #include "ogl.h"
     11 
     12 GLfloat
     13 ogl_vec3f_magnitude(
     14 	struct ogl_vec3f vector
     15 ) {
     16 	return sqrtf((vector.x*vector.x) + (vector.y*vector.y) + (vector.z*vector.z));
     17 }
     18