das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
Macros
form_rot.h File Reference

A rigid rotation from one reference frame into another. More...

#include <das3/form.h>
Include dependency graph for form_rot.h:

Go to the source code of this file.

Macros

#define DAS_FORM_ROT   (&das_form_rotate_vtbl)
 A rotation from one reference frame into another.
 

Detailed Description

A rigid rotation from one reference frame into another.

Rigid is the whole of it: lengths and handedness are preserved, so there is no scaling, no shear and no reflection. Everything this formalism promises follows from that one constraint. Two rotations compose into a rotation, applying one to a vector gives a vector in the second frame, and the inverse is the transpose. A transform that stretches or reflects satisfies none of those and is not a rotation; it would be a different kind= with its own rules, not this one carrying a flag.

WHO INCLUDES THIS

Two audiences, and NOT a third.

  1. A peer formalism that knows what a rotation is and implements a pairing with one. Knowledge between formalisms is a directed ACYCLIC graph: the file that knows more includes the other's header and implements the hook. form_rot.c includes form_vector.h because a rotation is defined as a thing that acts on vectors. The arrow must never come back – form_vector.c including THIS header would make the graph cyclic and is a design error, not a shortcut.
  2. A client that understands rotations: das3_spice building a rotated vector, a plotter labelling a transform. This header is deliberately NOT reachable through core.h; a client that wants rotations names them.

The third audience, generic library code, needs nothing here. It reaches everything through the DasForm vtable and never learns this type exists. If something in variable.c or dataset.c ever wants this header, the layering sprung a leak.

WHY THE VTABLE IS EXPORTED

das_form_rotate_vtbl is one object in the whole program, so comparing its ADDRESS answers "is this partner a rotation?" with no enum, no string, and no kind field to keep in sync with the vtable it would describe. That is the one reason a vtable here is extern rather than static; the recipe vtables inside form_rot.c stay static because nobody tags with them.

Macro Definition Documentation

◆ DAS_FORM_ROT

#define DAS_FORM_ROT   (&das_form_rotate_vtbl)

A rotation from one reference frame into another.

Applying one to a vector gives a vector in the second frame.

See also
DasForm_isKind(), DasVar_formIs().