![]() |
das2C
das core C utilities (v3)
|
A frame-tagged geometric vector. More...
#include <das3/form.h>

Go to the source code of this file.
Macros | |
| #define | DAS_FORM_VEC (&das_form_vector_vtbl) |
| A geometric vector in a reference frame. | |
Functions | |
| DAS_API const char * | das_vsys_str (ubyte uSys) |
| Wire token for a system code, or NULL if it is not one of this file's. | |
| DAS_API ubyte | das_vsys_id (const char *sSys) |
| Wire token to system code, 0 if unrecognized here. | |
| DAS_API const char * | das_vsys_desc (ubyte uSys) |
| One line of prose about a system, for a "notes" property. | |
| DAS_API const char * | das_vsys_symbol (ubyte uSys, int iDir) |
| The canonical symbol for direction iDir of a system: "x", "r", "λ" ... | |
| DAS_API int8_t | das_vsys_index (ubyte uSys, const char *sSymbol) |
| The inverse of das_vsys_symbol(): which direction a symbol names. | |
| DAS_API double | das_vsys_default (ubyte uSys, int iDir) |
| The value an ABSENT component of this system defaults to. | |
| DAS_API bool | das_vsys_toCart (ubyte uSys, const double *pIn, double *pOut) |
| Convert one vector from its system to cartesian. | |
| DAS_API bool | das_vsys_fromCart (ubyte uSys, const double *pIn, double *pOut) |
| The inverse of das_vsys_toCart(). | |
A frame-tagged geometric vector.
NO origin.
A magnetic field, a velocity, a displacement: something with direction and magnitude that is not measured FROM anywhere. Free vectors add, subtract and scale, and one day will dot and cross.
Contrast form_geoloc.h, which is the same components with an ORIGIN and is therefore an affine point: positions subtract to give one of these, and two of them cannot be added at all. The discriminator is the origin, which is why they are two formalisms and not one with a flag.
surface= and center= are ILLEGAL here and say so loudly. A surface is an ellipsoid reference and a center is an origin; a free vector has neither, so the systems needing them (detic, graphic) belong to geoloc.
Parameters:
frame= the frame's NAME. OPTIONAL: a frameless vector is legal, it just cannot be frame-checked against anything. body= describes the FRAME, and rides here because there is no frame object to fold it into. Two vectors in one frame can therefore disagree; the library carries both and the consumer decides. fixed= true when the frame does not rotate. system= cartesian | cylindrical | spherical | centric. Default cartesian, which is what nearly all measured data is. sysorder= which canonical direction each stored component holds, e.g. "1;0;2". Default ascending.
ANGLES ARE ALWAYS DEGREES on the wire, so units carries whatever the radial component is in. The conversion helpers below take and return degrees for that reason.
| #define DAS_FORM_VEC (&das_form_vector_vtbl) |
A geometric vector in a reference frame.
It has a direction and a magnitude but no starting point, so two of them add.
| DAS_API const char * das_vsys_str | ( | ubyte | uSys | ) |
Wire token for a system code, or NULL if it is not one of this file's.
form_geoloc.h has das_geosys_str() for the superset.
| DAS_API const char * das_vsys_desc | ( | ubyte | uSys | ) |
One line of prose about a system, for a "notes" property.
NULL if not one of this file's.
| DAS_API const char * das_vsys_symbol | ( | ubyte | uSys, |
| int | iDir | ||
| ) |
The canonical symbol for direction iDir of a system: "x", "r", "λ" ...
| DAS_API int8_t das_vsys_index | ( | ubyte | uSys, |
| const char * | sSymbol | ||
| ) |
The inverse of das_vsys_symbol(): which direction a symbol names.
| DAS_API double das_vsys_default | ( | ubyte | uSys, |
| int | iDir | ||
| ) |
The value an ABSENT component of this system defaults to.
Zero everywhere except a radius, which defaults to 1 so an angles-only vector reads as a unit direction rather than as a null vector. Positions want different defaults; see form_geoloc.h.
| DAS_API bool das_vsys_toCart | ( | ubyte | uSys, |
| const double * | pIn, | ||
| double * | pOut | ||
| ) |
Convert one vector from its system to cartesian.