COSMOS core
1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
|
3 element cartesian vector More...
#include <vector.h>
Public Member Functions | |
cvector () | |
cvector (double tx, double ty, double tz) | |
void | normalize (double scale=1.) |
Normalize cartesian vector in place, i.e. divides it by its own norm. More... | |
double | length () |
double | norm () |
double | norm2 () |
cvector | normalized (double scale=1.) |
Normalize cartesian vector. More... | |
double & | operator[] (const int index) |
Index into cvector. More... | |
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 | |
double | x = 0. |
X value. More... | |
double | y = 0. |
Y value. More... | |
double | z = 0. |
Z value. More... | |
3 element cartesian vector
3 double precision numbers representing a vector in a right handed cartesian space
|
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 |
double cvector::x = 0. |
X value.
double cvector::y = 0. |
Y value.
double cvector::z = 0. |
Z value.