das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
form_rot.h
Go to the documentation of this file.
1/* Copyright (C) 2026 Chris Piker <chris-piker@uiowa.edu>
2 *
3 * Author: C. Piker, via Claude Opus 5
4 *
5 * This file is part of das2C, the Core Das2 C Library.
6 *
7 * Das2C is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Lesser General Public License version 2.1 as published
9 * by the Free Software Foundation.
10 *
11 * Das2C is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * version 2.1 along with das2C; if not, see <http://www.gnu.org/licenses/>.
18 */
19
60#ifndef _das_form_rot_h_
61#define _das_form_rot_h_
62
63#include <das3/form.h>
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69/* Exported so that its address can be compared. One object in the whole
70 program, so its address answers "is this partner a rotation?". Client code
71 uses the DAS_FORM_ROT macro below and has no reason to name this directly. */
72DAS_API extern const DasForm_VTbl das_form_rotate_vtbl;
73
77#define DAS_FORM_ROT (&das_form_rotate_vtbl)
78
79
80/* The two representations, as element counts. A rotation's shape is NOT
81 stored on the form: it is the operand's declared intern=, and it arrives in
82 a das_operand. Storing it in both places is how the two drift apart.
83
84 Canonical element order, which is what sysorder= indexes:
85
86 matrix 0 xx 1 xy 2 xz 3 yx 4 yy 5 yz 6 zx 7 zy 8 zz
87 row major, row is the to= axis and column the from= axis
88 quaternion 0 w 1 x 2 y 3 z
89 scalar first, SPICE's convention
90
91 A stream storing a matrix column major says sysorder="0;3;6;1;4;7;2;5;8";
92 one storing a quaternion scalar last says sysorder="1;2;3;0". Every element
93 must be placed: a rotation has no default for a missing one. */
94#define ROT_MATRIX 9 /* intern="3;3" */
95#define ROT_QUAT 4 /* intern="4" */
96
106DAS_API int DasFormRotate_layout(const das_operand* pOp);
107
108
131DAS_API DasForm* new_DasFormRotate(const char* sFrom, const char* sTo);
132
136DAS_API const char* DasFormRotate_from(const DasForm* pThis);
137
140DAS_API const char* DasFormRotate_to(const DasForm* pThis);
141
142#ifdef __cplusplus
143}
144#endif
145
146#endif /* _das_form_rot_h_ */
What a variable's values (i.e.
The form layer's currency: a snapshot of the facts a formalism may need.
Definition form.h:139