![]() |
COSMOS core
1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
|
Quaternion, scalar last, using x, y, z. More...
#include <vector.h>
Public Member Functions | |
| quaternion () | |
| quaternion (cvector td, double tw) | |
| json11::Json | to_json () const |
| Convert class contents to JSON object. More... | |
| void | from_json (const string &s) |
| Set class contents from JSON string. More... | |
Public Attributes | |
| cvector | d |
| Orientation. More... | |
| double | w = 0. |
| Rotation. More... | |
Quaternion, scalar last, using x, y, z.
Can be thought of as rvector with scalar last. One can be set equal to other. First 3 elements are the scaled orientation axis. Fourth element is the scaled amount of rotation. Can alternatively be thought of as a cvector, followed by a scalar.
|
inline |
|
inline |
|
inline |
Set class contents from JSON string.
Parses the provided JSON-formatted string and sets the class data. String should be formatted like the string returned from to_json()
| s | JSON-formatted string to set class contents to |
| cvector quaternion::d |
Orientation.
| double quaternion::w = 0. |
Rotation.