Constants#
- PI = 3.141593#
- PI_2 = 1.570796#
- VEC2_LEN = 2#
Evaluates to the number of components of a
Vec2
.This symbol is useful when declaring a C array of floating point values to be used with
init_from_float()
andto_float()
, e.g.float v[GRAPHENE_VEC2_LEN]; // vec is defined elsewhere graphene_vec2_to_float (&vec, v); for (int i = 0; i < GRAPHENE_VEC2_LEN; i++) fprintf (stdout, "component %d: %g\n", i, v[i]);
- VEC3_LEN = 3#
Evaluates to the number of components of a
Vec3
.This symbol is useful when declaring a C array of floating point values to be used with
init_from_float()
andto_float()
, e.g.float v[GRAPHENE_VEC3_LEN]; // vec is defined elsewhere graphene_vec3_to_float (&vec, v); for (int i = 0; i < GRAPHENE_VEC2_LEN; i++) fprintf (stdout, "component %d: %g\n", i, v[i]);
- VEC4_LEN = 4#
Evaluates to the number of components of a
Vec4
.This symbol is useful when declaring a C array of floating point values to be used with
init_from_float()
andto_float()
, e.g.float v[GRAPHENE_VEC4_LEN]; // vec is defined elsewhere graphene_vec4_to_float (&vec, v); for (int i = 0; i < GRAPHENE_VEC4_LEN; i++) fprintf (stdout, "component %d: %g\n", i, v[i]);