LibJuno 1.0.4
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
64// @{"req": ["REQ-MATH-002", "REQ-MATH-003"]}
66{
67 double r;
68 double phi;
70
78{
79 double x;
80 double y;
82
97
102JUNO_MODULE_RESULT(JUNO_VEC2_F64_SPH_RESULT_T, JUNO_VEC2_F64_SPH_T);
103
108JUNO_MODULE_RESULT(JUNO_VEC2_F64_CART_RESULT_T, JUNO_VEC2_F64_CART_T);
109
114JUNO_MODULE_RESULT(JUNO_VEC2_F64_RESULT_T, JUNO_VEC2_F64_T);
115
123{
124 float r;
125 float phi;
127
135{
136 float x;
137 float y;
139
154
159JUNO_MODULE_RESULT(JUNO_VEC2_F32_SPH_RESULT_T, JUNO_VEC2_F32_SPH_T);
160
165JUNO_MODULE_RESULT(JUNO_VEC2_F32_CART_RESULT_T, JUNO_VEC2_F32_CART_T);
166
171JUNO_MODULE_RESULT(JUNO_VEC2_F32_RESULT_T, JUNO_VEC2_F32_T);
172
180{
181 int32_t r;
182 int32_t phi;
184
192{
193 int32_t x;
194 int32_t y;
196
211
216JUNO_MODULE_RESULT(JUNO_VEC2_I32_SPH_RESULT_T, JUNO_VEC2_I32_SPH_T);
217
222JUNO_MODULE_RESULT(JUNO_VEC2_I32_CART_RESULT_T, JUNO_VEC2_I32_CART_T);
223
228JUNO_MODULE_RESULT(JUNO_VEC2_I32_RESULT_T, JUNO_VEC2_I32_T);
229
237{
238 double r;
239 double phi;
240 double theta;
242
250{
251 double x;
252 double y;
253 double z;
255
270
275JUNO_MODULE_RESULT(JUNO_VEC3_F64_SPH_RESULT_T, JUNO_VEC3_F64_SPH_T);
276
281JUNO_MODULE_RESULT(JUNO_VEC3_F64_CART_RESULT_T, JUNO_VEC3_F64_CART_T);
282
287JUNO_MODULE_RESULT(JUNO_VEC3_F64_RESULT_T, JUNO_VEC3_F64_T);
288
296{
297 float r;
298 float phi;
299 float theta;
301
309{
310 float x;
311 float y;
312 float z;
314
329
334JUNO_MODULE_RESULT(JUNO_VEC3_F32_SPH_RESULT_T, JUNO_VEC3_F32_SPH_T);
335
340JUNO_MODULE_RESULT(JUNO_VEC3_F32_CART_RESULT_T, JUNO_VEC3_F32_CART_T);
341
346JUNO_MODULE_RESULT(JUNO_VEC3_F32_RESULT_T, JUNO_VEC3_F32_T);
347
355{
356 int32_t r;
357 int32_t phi;
358 int32_t theta;
360
368{
369 int32_t x;
370 int32_t y;
371 int32_t z;
373
388
393JUNO_MODULE_RESULT(JUNO_VEC3_I32_SPH_RESULT_T, JUNO_VEC3_I32_SPH_T);
394
399JUNO_MODULE_RESULT(JUNO_VEC3_I32_CART_RESULT_T, JUNO_VEC3_I32_CART_T);
400
405JUNO_MODULE_RESULT(JUNO_VEC3_I32_RESULT_T, JUNO_VEC3_I32_T);
406
414{
415 double r;
416 double phi;
417 double theta;
418 double rho;
420
428{
429 double x;
430 double y;
431 double z;
432 double w;
434
449
454JUNO_MODULE_RESULT(JUNO_VEC4_F64_RESULT_T, JUNO_VEC4_F64_T);
455
463{
464 float r;
465 float phi;
466 float theta;
467 float rho;
469
477{
478 float x;
479 float y;
480 float z;
481 float w;
483
498
503JUNO_MODULE_RESULT(JUNO_VEC4_F32_SPH_RESULT_T, JUNO_VEC4_F32_SPH_T);
504
509JUNO_MODULE_RESULT(JUNO_VEC4_F32_CART_RESULT_T, JUNO_VEC4_F32_CART_T);
510
515JUNO_MODULE_RESULT(JUNO_VEC4_F32_RESULT_T, JUNO_VEC4_F32_T);
516
524{
525 int32_t r;
526 int32_t phi;
527 int32_t theta;
528 int32_t rho;
530
538{
539 int32_t x;
540 int32_t y;
541 int32_t z;
542 int32_t w;
544
559
564JUNO_MODULE_RESULT(JUNO_VEC4_I32_SPH_RESULT_T, JUNO_VEC4_I32_SPH_T);
565
570JUNO_MODULE_RESULT(JUNO_VEC4_I32_CART_RESULT_T, JUNO_VEC4_I32_CART_T);
571
576JUNO_MODULE_RESULT(JUNO_VEC4_I32_RESULT_T, JUNO_VEC4_I32_T);
577
582typedef struct JUNO_M3X3_F64_TAG
583{
584 double mat[3][3];
586
591JUNO_MODULE_RESULT(JUNO_M3X3_F64_RESULT_T, JUNO_M3X3_F64_T);
592
597typedef struct JUNO_M3X3_F32_TAG
598{
599 float mat[3][3];
601
606JUNO_MODULE_RESULT(JUNO_M3X3_F32_RESULT_T, JUNO_M3X3_F32_T);
607
612typedef struct JUNO_M4X4_F64_TAG
613{
614 double mat[4][4];
616
621JUNO_MODULE_RESULT(JUNO_M4X4_F64_RESULT_T, JUNO_M4X4_F64_T);
622
627typedef struct JUNO_M4X4_F32_TAG
628{
629 float mat[4][4];
631
636JUNO_MODULE_RESULT(JUNO_M4X4_F32_RESULT_T, JUNO_M4X4_F32_T);
637
642typedef struct JUNO_M3X3_I32_TAG
643{
644 int32_t mat[3][3];
646
651JUNO_MODULE_RESULT(JUNO_M3X3_I32_RESULT_T, JUNO_M3X3_I32_T);
652
657typedef struct JUNO_M4X4_I32_TAG
658{
659 int32_t mat[4][4];
661
666JUNO_MODULE_RESULT(JUNO_M4X4_I32_RESULT_T, JUNO_M4X4_I32_T);
667
674// @{"req": ["REQ-MATH-004"]}
676{
677 struct {
678 double s;
679 double i;
680 double j;
681 double k;
683 double arr[4];
685
693{
694 struct {
695 float s;
696 float i;
697 float j;
698 float k;
700 float arr[4];
702
707JUNO_MODULE_RESULT(JUNO_RQUAT_F64_RESULT_T, JUNO_RQUAT_F64_T);
708
716{
717 struct {
718 int32_t s;
719 int32_t i;
720 int32_t j;
721 int32_t k;
723 int32_t arr[4];
725
730JUNO_MODULE_RESULT(JUNO_RQUAT_I32_RESULT_T, JUNO_RQUAT_I32_T);
731
732#ifdef __cplusplus
733}
734#endif
735#endif
#define JUNO_MODULE_RESULT(NAME_T, OK_T)
Define a result type combining a status and a success payload.
Definition module.h:198
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:598
float mat[3][3]
Definition juno_vec_types.h:599
3×3 matrix of double-precision values.
Definition juno_vec_types.h:583
double mat[3][3]
Definition juno_vec_types.h:584
3×3 matrix of 32-bit integers.
Definition juno_vec_types.h:643
int32_t mat[3][3]
Definition juno_vec_types.h:644
4×4 matrix of float32-precision values.
Definition juno_vec_types.h:628
float mat[4][4]
Definition juno_vec_types.h:629
4×4 matrix of double-precision values.
Definition juno_vec_types.h:613
double mat[4][4]
Definition juno_vec_types.h:614
4×4 matrix of 32-bit integers.
Definition juno_vec_types.h:658
int32_t mat[4][4]
Definition juno_vec_types.h:659
2D vector in Cartesian coordinates (float precision).
Definition juno_vec_types.h:135
float y
Definition juno_vec_types.h:137
float x
Definition juno_vec_types.h:136
2D vector in polar coordinates (float precision).
Definition juno_vec_types.h:123
float phi
Definition juno_vec_types.h:125
float r
Definition juno_vec_types.h:124
2D vector in Cartesian coordinates (double precision).
Definition juno_vec_types.h:78
double y
Definition juno_vec_types.h:80
double x
Definition juno_vec_types.h:79
2D vector in polar coordinates (double precision).
Definition juno_vec_types.h:66
double phi
Definition juno_vec_types.h:68
double r
Definition juno_vec_types.h:67
2D vector in Cartesian coordinates (32-bit integer).
Definition juno_vec_types.h:192
int32_t x
Definition juno_vec_types.h:193
int32_t y
Definition juno_vec_types.h:194
2D vector in polar coordinates (32-bit integer).
Definition juno_vec_types.h:180
int32_t phi
Definition juno_vec_types.h:182
int32_t r
Definition juno_vec_types.h:181
4D vector in Cartesian coordinates (float precision).
Definition juno_vec_types.h:309
float z
Definition juno_vec_types.h:312
float x
Definition juno_vec_types.h:310
float y
Definition juno_vec_types.h:311
4D vector in hyperspherical coordinates (float precision).
Definition juno_vec_types.h:296
float r
Definition juno_vec_types.h:297
float theta
Definition juno_vec_types.h:299
float phi
Definition juno_vec_types.h:298
3D vector in Cartesian coordinates (double precision).
Definition juno_vec_types.h:250
double x
Definition juno_vec_types.h:251
double z
Definition juno_vec_types.h:253
double y
Definition juno_vec_types.h:252
3D vector in spherical coordinates (float precision).
Definition juno_vec_types.h:237
double phi
Definition juno_vec_types.h:239
double r
Definition juno_vec_types.h:238
double theta
Definition juno_vec_types.h:240
3D vector in Cartesian coordinates (32-bit integer).
Definition juno_vec_types.h:368
int32_t z
Definition juno_vec_types.h:371
int32_t y
Definition juno_vec_types.h:370
int32_t x
Definition juno_vec_types.h:369
3D vector in spherical coordinates (32-bit integer).
Definition juno_vec_types.h:355
int32_t theta
Definition juno_vec_types.h:358
int32_t phi
Definition juno_vec_types.h:357
int32_t r
Definition juno_vec_types.h:356
3D vector in Cartesian coordinates (float precision).
Definition juno_vec_types.h:477
float x
Definition juno_vec_types.h:478
float w
Definition juno_vec_types.h:481
float z
Definition juno_vec_types.h:480
float y
Definition juno_vec_types.h:479
3D vector in spherical coordinates (double precision).
Definition juno_vec_types.h:463
float theta
Definition juno_vec_types.h:466
float phi
Definition juno_vec_types.h:465
float rho
Definition juno_vec_types.h:467
float r
Definition juno_vec_types.h:464
4D vector in Cartesian coordinates (double precision).
Definition juno_vec_types.h:428
double x
Definition juno_vec_types.h:429
double w
Definition juno_vec_types.h:432
double y
Definition juno_vec_types.h:430
double z
Definition juno_vec_types.h:431
4D vector in hyperspherical coordinates (double precision).
Definition juno_vec_types.h:414
double r
Definition juno_vec_types.h:415
double rho
Definition juno_vec_types.h:418
double theta
Definition juno_vec_types.h:417
double phi
Definition juno_vec_types.h:416
4D vector in Cartesian coordinates (32-bit integer).
Definition juno_vec_types.h:538
int32_t w
Definition juno_vec_types.h:542
int32_t y
Definition juno_vec_types.h:540
int32_t x
Definition juno_vec_types.h:539
int32_t z
Definition juno_vec_types.h:541
4D vector in hyperspherical coordinates (32-bit integer).
Definition juno_vec_types.h:524
int32_t rho
Definition juno_vec_types.h:528
int32_t theta
Definition juno_vec_types.h:527
int32_t r
Definition juno_vec_types.h:525
int32_t phi
Definition juno_vec_types.h:526
Right-handed quaternion (float precision).
Definition juno_vec_types.h:693
float k
Definition juno_vec_types.h:698
float s
Definition juno_vec_types.h:695
float i
Definition juno_vec_types.h:696
float j
Definition juno_vec_types.h:697
float arr[4]
Definition juno_vec_types.h:700
struct JUNO_RQUAT_F32_TAG::@1 tQuat
Right-handed quaternion (double precision).
Definition juno_vec_types.h:676
double arr[4]
Definition juno_vec_types.h:683
double k
Definition juno_vec_types.h:681
struct JUNO_RQUAT_F64_TAG::@0 tQuat
double j
Definition juno_vec_types.h:680
double s
Definition juno_vec_types.h:678
double i
Definition juno_vec_types.h:679
Right-handed quaternion (32-bit integer).
Definition juno_vec_types.h:716
int32_t arr[4]
Definition juno_vec_types.h:723
int32_t j
Definition juno_vec_types.h:720
int32_t i
Definition juno_vec_types.h:719
int32_t k
Definition juno_vec_types.h:721
struct JUNO_RQUAT_I32_TAG::@2 tQuat
int32_t s
Definition juno_vec_types.h:718
2D vector union supporting Cartesian, polar, and array access (float32 precision).
Definition juno_vec_types.h:149
JUNO_VEC2_F32_CART_T tCart
Definition juno_vec_types.h:150
JUNO_VEC2_F32_SPH_T tSph
Definition juno_vec_types.h:151
float arr[2]
Definition juno_vec_types.h:152
2D vector union supporting Cartesian, polar, and array access (double precision).
Definition juno_vec_types.h:92
JUNO_VEC2_F64_CART_T tCart
Definition juno_vec_types.h:93
JUNO_VEC2_F64_SPH_T tSph
Definition juno_vec_types.h:94
double arr[2]
Definition juno_vec_types.h:95
2D vector union supporting Cartesian, polar, and array access (32-bit integer).
Definition juno_vec_types.h:206
JUNO_VEC2_I32_CART_T tCart
Definition juno_vec_types.h:207
int32_t arr[2]
Definition juno_vec_types.h:209
JUNO_VEC2_I32_SPH_T tSph
Definition juno_vec_types.h:208
3D vector union supporting Cartesian, spherical, and array access (float32 precision).
Definition juno_vec_types.h:324
float arr[3]
Definition juno_vec_types.h:327
JUNO_VEC3_F32_SPH_T tSph
Definition juno_vec_types.h:326
JUNO_VEC3_F32_CART_T tCart
Definition juno_vec_types.h:325
3D vector union supporting Cartesian, spherical, and array access (double precision).
Definition juno_vec_types.h:265
double arr[3]
Definition juno_vec_types.h:268
JUNO_VEC3_F64_SPH_T tSph
Definition juno_vec_types.h:267
JUNO_VEC3_F64_CART_T tCart
Definition juno_vec_types.h:266
3D vector union supporting Cartesian, spherical, and array access (32-bit integer).
Definition juno_vec_types.h:383
int32_t arr[3]
Definition juno_vec_types.h:386
JUNO_VEC3_I32_CART_T tCart
Definition juno_vec_types.h:384
JUNO_VEC3_I32_SPH_T tSph
Definition juno_vec_types.h:385
4D vector union supporting Cartesian, hyperspherical, and array access (float32 precision).
Definition juno_vec_types.h:493
float arr[4]
Definition juno_vec_types.h:496
JUNO_VEC4_F32_CART_T tCart
Definition juno_vec_types.h:494
JUNO_VEC4_F32_SPH_T tSph
Definition juno_vec_types.h:495
4D vector union supporting Cartesian, hyperspherical, and array access (double precision).
Definition juno_vec_types.h:444
JUNO_VEC4_F64_SPH_T tSph
Definition juno_vec_types.h:446
double arr[4]
Definition juno_vec_types.h:447
JUNO_VEC4_F64_CART_T tCart
Definition juno_vec_types.h:445
4D vector union supporting Cartesian, hyperspherical, and array access (32-bit integer).
Definition juno_vec_types.h:554
JUNO_VEC4_I32_CART_T tCart
Definition juno_vec_types.h:555
JUNO_VEC4_I32_SPH_T tSph
Definition juno_vec_types.h:556
int32_t arr[4]
Definition juno_vec_types.h:557