LibJuno 1.0.4
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
juno_math.h File Reference

Convenience header: math types plus inline vector/quaternion ops. More...

#include "juno_math_types.h"
#include "juno_vec.h"
#include "juno/math/juno_math_constants.h"
#include <stdint.h>
Include dependency graph for juno_math.h:

Go to the source code of this file.

Macros

#define Juno_Deg2Rad(deg)   deg * JUNO_PI / 180.0
 
#define Juno_Rad2Deg(rad)   rad * 180.0 / JUNO_PI
 

Detailed Description

Convenience header: math types plus inline vector/quaternion ops.

Umbrella include that aggregates:

  • juno_math_types.h — structural type definitions (vectors, matrices, real quaternions)
  • juno_vec.h — inline operations (add/sub/scale, dot/cross, norms, quaternion algebra)

Use this header when you want both the math types and the inline utilities in one place. If you only need type definitions without inline operations, prefer juno_math_types.h.

Quaternions use the component order [s, i, j, k] and the Hamilton product follows the right-handed convention (i^2 = j^2 = k^2 = ijk = -1). See Juno_RQuat_F64_HamProd in juno_vec.h for the exact formula.

JUNO_VEC3_F64_T a = {{1.0, 2.0, 3.0}};
JUNO_VEC3_F64_T b = {{4.0, 5.0, 6.0}};
JUNO_VEC3_F64_T c = Juno_Vec3_F64_Add(a, b); // {5, 7, 9}
Convenience header: math types plus inline vector/quaternion ops.
static JUNO_VEC3_F64_T Juno_Vec3_F64_Add(JUNO_VEC3_F64_T tVec0, JUNO_VEC3_F64_T tVec1)
Add two 3D vectors (double).
Definition juno_vec.h:265
3D vector union supporting Cartesian, spherical, and array access (double precision).
Definition juno_vec_types.h:265

Macro Definition Documentation

◆ Juno_Deg2Rad

#define Juno_Deg2Rad (   deg)    deg * JUNO_PI / 180.0

◆ Juno_Rad2Deg

#define Juno_Rad2Deg (   rad)    rad * 180.0 / JUNO_PI