LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
juno_vec_types.h
Go to the documentation of this file.
1/*
2 MIT License
3
4 Copyright (c) 2025 Robin A. Onsay
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files
8 (the "Software"), to deal in the Software without restriction,
9 including without limitation the rights to use, copy, modify, merge,
10 publish, distribute, sublicense, and/or sell copies of the Software,
11 and to permit persons to whom the Software is furnished to do so,
12 subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16*/
17
29#ifndef JUNO_VEC_TYPES_H
30#define JUNO_VEC_TYPES_H
31
32#include "juno/module.h"
33#include <stddef.h>
34#ifdef __cplusplus
35extern "C" {
36#endif
37#include <stdint.h>
38
45#ifndef JUNO_INT_TYPE
46#define JUNO_INT_TYPE int64_t
47#endif
48
55#ifndef JUNO_FLOAT_TYPE
56#define JUNO_FLOAT_TYPE double
57#endif
65{
66 double r;
67 double phi;
69
77{
78 double x;
79 double y;
81
96
101JUNO_MODULE_RESULT(JUNO_VEC2_F64_SPH_RESULT_T, JUNO_VEC2_F64_SPH_T);
102
107JUNO_MODULE_RESULT(JUNO_VEC2_F64_CART_RESULT_T, JUNO_VEC2_F64_CART_T);
108
113JUNO_MODULE_RESULT(JUNO_VEC2_F64_RESULT_T, JUNO_VEC2_F64_T);
114
122{
123 float r;
124 float phi;
126
134{
135 float x;
136 float y;
138
153
158JUNO_MODULE_RESULT(JUNO_VEC2_F32_SPH_RESULT_T, JUNO_VEC2_F32_SPH_T);
159
164JUNO_MODULE_RESULT(JUNO_VEC2_F32_CART_RESULT_T, JUNO_VEC2_F32_CART_T);
165
170JUNO_MODULE_RESULT(JUNO_VEC2_F32_RESULT_T, JUNO_VEC2_F32_T);
171
179{
180 int32_t r;
181 int32_t phi;
183
191{
192 int32_t x;
193 int32_t y;
195
210
215JUNO_MODULE_RESULT(JUNO_VEC2_I32_SPH_RESULT_T, JUNO_VEC2_I32_SPH_T);
216
221JUNO_MODULE_RESULT(JUNO_VEC2_I32_CART_RESULT_T, JUNO_VEC2_I32_CART_T);
222
227JUNO_MODULE_RESULT(JUNO_VEC2_I32_RESULT_T, JUNO_VEC2_I32_T);
228
236{
237 double r;
238 double phi;
239 double theta;
241
249{
250 double x;
251 double y;
252 double z;
254
269
274JUNO_MODULE_RESULT(JUNO_VEC3_F64_SPH_RESULT_T, JUNO_VEC3_F64_SPH_T);
275
280JUNO_MODULE_RESULT(JUNO_VEC3_F64_CART_RESULT_T, JUNO_VEC3_F64_CART_T);
281
286JUNO_MODULE_RESULT(JUNO_VEC3_F64_RESULT_T, JUNO_VEC3_F64_T);
287
295{
296 float r;
297 float phi;
298 float theta;
300
308{
309 float x;
310 float y;
311 float z;
313
328
333JUNO_MODULE_RESULT(JUNO_VEC3_F32_SPH_RESULT_T, JUNO_VEC3_F32_SPH_T);
334
339JUNO_MODULE_RESULT(JUNO_VEC3_F32_CART_RESULT_T, JUNO_VEC3_F32_CART_T);
340
345JUNO_MODULE_RESULT(JUNO_VEC3_F32_RESULT_T, JUNO_VEC3_F32_T);
346
354{
355 int32_t r;
356 int32_t phi;
357 int32_t theta;
359
367{
368 int32_t x;
369 int32_t y;
370 int32_t z;
372
387
392JUNO_MODULE_RESULT(JUNO_VEC3_I32_SPH_RESULT_T, JUNO_VEC3_I32_SPH_T);
393
398JUNO_MODULE_RESULT(JUNO_VEC3_I32_CART_RESULT_T, JUNO_VEC3_I32_CART_T);
399
404JUNO_MODULE_RESULT(JUNO_VEC3_I32_RESULT_T, JUNO_VEC3_I32_T);
405
413{
414 double r;
415 double phi;
416 double theta;
417 double rho;
419
427{
428 double x;
429 double y;
430 double z;
431 double w;
433
448
453JUNO_MODULE_RESULT(JUNO_VEC4_F64_RESULT_T, JUNO_VEC4_F64_T);
454
462{
463 float r;
464 float phi;
465 float theta;
466 float rho;
468
476{
477 float x;
478 float y;
479 float z;
480 float w;
482
497
502JUNO_MODULE_RESULT(JUNO_VEC4_F32_SPH_RESULT_T, JUNO_VEC4_F32_SPH_T);
503
508JUNO_MODULE_RESULT(JUNO_VEC4_F32_CART_RESULT_T, JUNO_VEC4_F32_CART_T);
509
514JUNO_MODULE_RESULT(JUNO_VEC4_F32_RESULT_T, JUNO_VEC4_F32_T);
515
523{
524 int32_t r;
525 int32_t phi;
526 int32_t theta;
527 int32_t rho;
529
537{
538 int32_t x;
539 int32_t y;
540 int32_t z;
541 int32_t w;
543
558
563JUNO_MODULE_RESULT(JUNO_VEC4_I32_SPH_RESULT_T, JUNO_VEC4_I32_SPH_T);
564
569JUNO_MODULE_RESULT(JUNO_VEC4_I32_CART_RESULT_T, JUNO_VEC4_I32_CART_T);
570
575JUNO_MODULE_RESULT(JUNO_VEC4_I32_RESULT_T, JUNO_VEC4_I32_T);
576
581typedef struct JUNO_M3X3_F64_TAG
582{
583 double mat[3][3];
585
590JUNO_MODULE_RESULT(JUNO_M3X3_F64_RESULT_T, JUNO_M3X3_F64_T);
591
596typedef struct JUNO_M3X3_F32_TAG
597{
598 float mat[3][3];
600
605JUNO_MODULE_RESULT(JUNO_M3X3_F32_RESULT_T, JUNO_M3X3_F32_T);
606
611typedef struct JUNO_M4X4_F64_TAG
612{
613 double mat[4][4];
615
620JUNO_MODULE_RESULT(JUNO_M4X4_F64_RESULT_T, JUNO_M4X4_F64_T);
621
626typedef struct JUNO_M4X4_F32_TAG
627{
628 float mat[4][4];
630
635JUNO_MODULE_RESULT(JUNO_M4X4_F32_RESULT_T, JUNO_M4X4_F32_T);
636
641typedef struct JUNO_M3X3_I32_TAG
642{
643 int32_t mat[3][3];
645
650JUNO_MODULE_RESULT(JUNO_M3X3_I32_RESULT_T, JUNO_M3X3_I32_T);
651
656typedef struct JUNO_M4X4_I32_TAG
657{
658 int32_t mat[4][4];
660
665JUNO_MODULE_RESULT(JUNO_M4X4_I32_RESULT_T, JUNO_M4X4_I32_T);
666
674{
675 struct {
676 double s;
677 double i;
678 double j;
679 double k;
681 double arr[4];
683
691{
692 struct {
693 float s;
694 float i;
695 float j;
696 float k;
698 float arr[4];
700
705JUNO_MODULE_RESULT(JUNO_RQUAT_F64_RESULT_T, JUNO_RQUAT_F64_T);
706
714{
715 struct {
716 int32_t s;
717 int32_t i;
718 int32_t j;
719 int32_t k;
721 int32_t arr[4];
723
728JUNO_MODULE_RESULT(JUNO_RQUAT_I32_RESULT_T, JUNO_RQUAT_I32_T);
729
730#ifdef __cplusplus
731}
732#endif
733#endif
#define JUNO_MODULE_RESULT(NAME_T, OK_T)
Define a result type combining a status and a success payload.
Definition module.h:193
struct JUNO_VEC4_I32_CART_TAG JUNO_VEC4_I32_CART_T
struct JUNO_VEC2_F64_CART_TAG JUNO_VEC2_F64_CART_T
struct JUNO_VEC2_F32_CART_TAG JUNO_VEC2_F32_CART_T
struct JUNO_VEC2_F32_SPH_TAG JUNO_VEC2_F32_SPH_T
union JUNO_VEC4_I32_TAG JUNO_VEC4_I32_T
union JUNO_RQUAT_F32_TAG JUNO_RQUAT_F32_T
struct JUNO_M4X4_I32_TAG JUNO_M4X4_I32_T
struct JUNO_M3X3_I32_TAG JUNO_M3X3_I32_T
struct JUNO_M3X3_F32_TAG JUNO_M3X3_F32_T
struct JUNO_VEC2_I32_SPH_TAG JUNO_VEC2_I32_SPH_T
struct JUNO_VEC4_F32_CART_TAG JUNO_VEC4_F32_CART_T
struct JUNO_VEC4_F64_CART_TAG JUNO_VEC4_F64_CART_T
struct JUNO_VEC3_I32_SPH_TAG JUNO_VEC3_I32_SPH_T
struct JUNO_VEC4_F64_SPH_TAG JUNO_VEC4_F64_SPH_T
struct JUNO_M4X4_F32_TAG JUNO_M4X4_F32_T
struct JUNO_VEC4_I32_SPH_TAG JUNO_VEC4_I32_SPH_T
struct JUNO_M3X3_F64_TAG JUNO_M3X3_F64_T
union JUNO_VEC3_F64_TAG JUNO_VEC3_F64_T
union JUNO_VEC3_I32_TAG JUNO_VEC3_I32_T
struct JUNO_VEC2_I32_CART_TAG JUNO_VEC2_I32_CART_T
struct JUNO_VEC3_F32_CART_TAG JUNO_VEC3_F32_CART_T
union JUNO_VEC4_F32_TAG JUNO_VEC4_F32_T
union JUNO_VEC3_F32_TAG JUNO_VEC3_F32_T
union JUNO_RQUAT_I32_TAG JUNO_RQUAT_I32_T
struct JUNO_VEC4_F32_SPH_TAG JUNO_VEC4_F32_SPH_T
union JUNO_VEC2_I32_TAG JUNO_VEC2_I32_T
struct JUNO_VEC3_F64_SPH_TAG JUNO_VEC3_F64_SPH_T
struct JUNO_VEC2_F64_SPH_TAG JUNO_VEC2_F64_SPH_T
struct JUNO_M4X4_F64_TAG JUNO_M4X4_F64_T
struct JUNO_VEC3_F64_CART_TAG JUNO_VEC3_F64_CART_T
struct JUNO_VEC3_I32_CART_TAG JUNO_VEC3_I32_CART_T
union JUNO_VEC4_F64_TAG JUNO_VEC4_F64_T
union JUNO_VEC2_F64_TAG JUNO_VEC2_F64_T
struct JUNO_VEC3_F32_SPH_TAG JUNO_VEC3_F32_SPH_T
union JUNO_VEC2_F32_TAG JUNO_VEC2_F32_T
union JUNO_RQUAT_F64_TAG JUNO_RQUAT_F64_T
Module system and dependency injection primitives for LibJuno.
3×3 matrix of float32-precision values.
Definition juno_vec_types.h:597
float mat[3][3]
Definition juno_vec_types.h:598
3×3 matrix of double-precision values.
Definition juno_vec_types.h:582
double mat[3][3]
Definition juno_vec_types.h:583
3×3 matrix of 32-bit integers.
Definition juno_vec_types.h:642
int32_t mat[3][3]
Definition juno_vec_types.h:643
4×4 matrix of float32-precision values.
Definition juno_vec_types.h:627
float mat[4][4]
Definition juno_vec_types.h:628
4×4 matrix of double-precision values.
Definition juno_vec_types.h:612
double mat[4][4]
Definition juno_vec_types.h:613
4×4 matrix of 32-bit integers.
Definition juno_vec_types.h:657
int32_t mat[4][4]
Definition juno_vec_types.h:658
2D vector in Cartesian coordinates (float precision).
Definition juno_vec_types.h:134
float y
Definition juno_vec_types.h:136
float x
Definition juno_vec_types.h:135
2D vector in polar coordinates (float precision).
Definition juno_vec_types.h:122
float phi
Definition juno_vec_types.h:124
float r
Definition juno_vec_types.h:123
2D vector in Cartesian coordinates (double precision).
Definition juno_vec_types.h:77
double y
Definition juno_vec_types.h:79
double x
Definition juno_vec_types.h:78
2D vector in polar coordinates (double precision).
Definition juno_vec_types.h:65
double phi
Definition juno_vec_types.h:67
double r
Definition juno_vec_types.h:66
2D vector in Cartesian coordinates (32-bit integer).
Definition juno_vec_types.h:191
int32_t x
Definition juno_vec_types.h:192
int32_t y
Definition juno_vec_types.h:193
2D vector in polar coordinates (32-bit integer).
Definition juno_vec_types.h:179
int32_t phi
Definition juno_vec_types.h:181
int32_t r
Definition juno_vec_types.h:180
4D vector in Cartesian coordinates (float precision).
Definition juno_vec_types.h:308
float z
Definition juno_vec_types.h:311
float x
Definition juno_vec_types.h:309
float y
Definition juno_vec_types.h:310
4D vector in hyperspherical coordinates (float precision).
Definition juno_vec_types.h:295
float r
Definition juno_vec_types.h:296
float theta
Definition juno_vec_types.h:298
float phi
Definition juno_vec_types.h:297
3D vector in Cartesian coordinates (double precision).
Definition juno_vec_types.h:249
double x
Definition juno_vec_types.h:250
double z
Definition juno_vec_types.h:252
double y
Definition juno_vec_types.h:251
3D vector in spherical coordinates (float precision).
Definition juno_vec_types.h:236
double phi
Definition juno_vec_types.h:238
double r
Definition juno_vec_types.h:237
double theta
Definition juno_vec_types.h:239
3D vector in Cartesian coordinates (32-bit integer).
Definition juno_vec_types.h:367
int32_t z
Definition juno_vec_types.h:370
int32_t y
Definition juno_vec_types.h:369
int32_t x
Definition juno_vec_types.h:368
3D vector in spherical coordinates (32-bit integer).
Definition juno_vec_types.h:354
int32_t theta
Definition juno_vec_types.h:357
int32_t phi
Definition juno_vec_types.h:356
int32_t r
Definition juno_vec_types.h:355
3D vector in Cartesian coordinates (float precision).
Definition juno_vec_types.h:476
float x
Definition juno_vec_types.h:477
float w
Definition juno_vec_types.h:480
float z
Definition juno_vec_types.h:479
float y
Definition juno_vec_types.h:478
3D vector in spherical coordinates (double precision).
Definition juno_vec_types.h:462
float theta
Definition juno_vec_types.h:465
float phi
Definition juno_vec_types.h:464
float rho
Definition juno_vec_types.h:466
float r
Definition juno_vec_types.h:463
4D vector in Cartesian coordinates (double precision).
Definition juno_vec_types.h:427
double x
Definition juno_vec_types.h:428
double w
Definition juno_vec_types.h:431
double y
Definition juno_vec_types.h:429
double z
Definition juno_vec_types.h:430
4D vector in hyperspherical coordinates (double precision).
Definition juno_vec_types.h:413
double r
Definition juno_vec_types.h:414
double rho
Definition juno_vec_types.h:417
double theta
Definition juno_vec_types.h:416
double phi
Definition juno_vec_types.h:415
4D vector in Cartesian coordinates (32-bit integer).
Definition juno_vec_types.h:537
int32_t w
Definition juno_vec_types.h:541
int32_t y
Definition juno_vec_types.h:539
int32_t x
Definition juno_vec_types.h:538
int32_t z
Definition juno_vec_types.h:540
4D vector in hyperspherical coordinates (32-bit integer).
Definition juno_vec_types.h:523
int32_t rho
Definition juno_vec_types.h:527
int32_t theta
Definition juno_vec_types.h:526
int32_t r
Definition juno_vec_types.h:524
int32_t phi
Definition juno_vec_types.h:525
Right-handed quaternion (float precision).
Definition juno_vec_types.h:691
float k
Definition juno_vec_types.h:696
float s
Definition juno_vec_types.h:693
float i
Definition juno_vec_types.h:694
float j
Definition juno_vec_types.h:695
float arr[4]
Definition juno_vec_types.h:698
struct JUNO_RQUAT_F32_TAG::@1 tQuat
Right-handed quaternion (double precision).
Definition juno_vec_types.h:674
double arr[4]
Definition juno_vec_types.h:681
double k
Definition juno_vec_types.h:679
struct JUNO_RQUAT_F64_TAG::@0 tQuat
double j
Definition juno_vec_types.h:678
double s
Definition juno_vec_types.h:676
double i
Definition juno_vec_types.h:677
Right-handed quaternion (32-bit integer).
Definition juno_vec_types.h:714
int32_t arr[4]
Definition juno_vec_types.h:721
int32_t j
Definition juno_vec_types.h:718
int32_t i
Definition juno_vec_types.h:717
int32_t k
Definition juno_vec_types.h:719
struct JUNO_RQUAT_I32_TAG::@2 tQuat
int32_t s
Definition juno_vec_types.h:716
2D vector union supporting Cartesian, polar, and array access (float32 precision).
Definition juno_vec_types.h:148
JUNO_VEC2_F32_CART_T tCart
Definition juno_vec_types.h:149
JUNO_VEC2_F32_SPH_T tSph
Definition juno_vec_types.h:150
float arr[2]
Definition juno_vec_types.h:151
2D vector union supporting Cartesian, polar, and array access (double precision).
Definition juno_vec_types.h:91
JUNO_VEC2_F64_CART_T tCart
Definition juno_vec_types.h:92
JUNO_VEC2_F64_SPH_T tSph
Definition juno_vec_types.h:93
double arr[2]
Definition juno_vec_types.h:94
2D vector union supporting Cartesian, polar, and array access (32-bit integer).
Definition juno_vec_types.h:205
JUNO_VEC2_I32_CART_T tCart
Definition juno_vec_types.h:206
int32_t arr[2]
Definition juno_vec_types.h:208
JUNO_VEC2_I32_SPH_T tSph
Definition juno_vec_types.h:207
3D vector union supporting Cartesian, spherical, and array access (float32 precision).
Definition juno_vec_types.h:323
float arr[3]
Definition juno_vec_types.h:326
JUNO_VEC3_F32_SPH_T tSph
Definition juno_vec_types.h:325
JUNO_VEC3_F32_CART_T tCart
Definition juno_vec_types.h:324
3D vector union supporting Cartesian, spherical, and array access (double precision).
Definition juno_vec_types.h:264
double arr[3]
Definition juno_vec_types.h:267
JUNO_VEC3_F64_SPH_T tSph
Definition juno_vec_types.h:266
JUNO_VEC3_F64_CART_T tCart
Definition juno_vec_types.h:265
3D vector union supporting Cartesian, spherical, and array access (32-bit integer).
Definition juno_vec_types.h:382
int32_t arr[3]
Definition juno_vec_types.h:385
JUNO_VEC3_I32_CART_T tCart
Definition juno_vec_types.h:383
JUNO_VEC3_I32_SPH_T tSph
Definition juno_vec_types.h:384
4D vector union supporting Cartesian, hyperspherical, and array access (float32 precision).
Definition juno_vec_types.h:492
float arr[4]
Definition juno_vec_types.h:495
JUNO_VEC4_F32_CART_T tCart
Definition juno_vec_types.h:493
JUNO_VEC4_F32_SPH_T tSph
Definition juno_vec_types.h:494
4D vector union supporting Cartesian, hyperspherical, and array access (double precision).
Definition juno_vec_types.h:443
JUNO_VEC4_F64_SPH_T tSph
Definition juno_vec_types.h:445
double arr[4]
Definition juno_vec_types.h:446
JUNO_VEC4_F64_CART_T tCart
Definition juno_vec_types.h:444
4D vector union supporting Cartesian, hyperspherical, and array access (32-bit integer).
Definition juno_vec_types.h:553
JUNO_VEC4_I32_CART_T tCart
Definition juno_vec_types.h:554
JUNO_VEC4_I32_SPH_T tSph
Definition juno_vec_types.h:555
int32_t arr[4]
Definition juno_vec_types.h:556