ICAROUS
|
#include <Velocity.h>
Public Member Functions | |
Velocity () | |
Velocity (const Vect3 &v3) | |
double | angle (const std::string &uangle) const |
double | angle () const |
double | trk () const |
double | track (const std::string &utrk) const |
double | compassAngle () const |
double | compassAngle (const std::string &u) const |
double | gs () const |
double | groundSpeed (const std::string &ugs) const |
double | vs () const |
double | verticalSpeed (const std::string &uvs) const |
bool | compare (const Velocity &v, double maxTrk, double maxGs, double maxVs) |
bool | compare (const Velocity &v, double horizDelta, double vertDelta) |
Velocity | mkAddTrk (double trk) const |
Velocity | mkTrk (double trk) const |
Velocity | mkTrk (double trk, std::string u) const |
Velocity | mkGs (double gs) const |
Velocity | mkGs (double gs, std::string u) const |
Velocity | mkVs (double vs) const |
Velocity | mkVs (double vs, std::string u) const |
Velocity | NegV () const |
Velocity | zeroSmallVs (double threshold) const |
std::string | toUnitTest () const |
std::string | toString () const |
std::string | toString (int prec) const |
std::string | toStringUnits () const |
std::string | toStringUnits (const std::string &trkUnits, const std::string &gsUnits, const std::string &vsUnits) const |
std::string | toStringXYZ () const |
std::string | toStringXYZ (int prec) const |
std::vector< std::string > | toStringList () const |
std::vector< std::string > | toStringList (int precision) const |
std::vector< std::string > | toStringXYZList () const |
std::vector< std::string > | toStringXYZList (int precision) const |
std::string | toStringNP () const |
std::string | toStringNP (int precision) const |
std::string | toStringNP (const std::string &utrk, const std::string &ugs, const std::string &uvs, int precision) const |
![]() | |
Vect3 (const double xx=0, const double yy=0, const double zz=0) | |
Vect3 (const Vect2 &v, const double vz) | |
virtual | ~Vect3 () |
Vect3 | mkX (double nx) |
Vect3 | mkY (double ny) |
Vect3 | mkZ (double nz) |
bool | isZero () const |
bool | almostEquals (const Vect3 &v) const |
bool | almostEquals2D (const Vect3 &v, double horizEps) const |
bool | almostEquals (const Vect3 &v, INT64FM maxUlps) const |
bool | within_epsilon (const Vect3 &v2, double epsilon) const |
Vect3 | operator+ (const Vect3 &v) const |
Vect3 | operator- (const Vect3 &v) const |
Vect3 | operator- () const |
Vect3 | operator* (const double k) const |
double | operator* (const Vect3 &v) const |
bool | operator== (const Vect3 &v) const |
bool | operator!= (const Vect3 &v) const |
Vect3 | ScalAdd (const double k, const Vect3 &v) const |
Vect3 | AddScal (double k, const Vect3 &v) const |
Vect3 | PerpR () const |
Vect3 | PerpL () const |
Vect3 | linear (const Vect3 &v, double t) const |
Vect3 | linearByDist2D (double track, double d) const |
Vect2 | vect2 () const |
Vect3 | Hat () const |
Vect3 | cross (const Vect3 &v) const |
bool | parallel (const Vect3 &v) const |
Vect3 | Add (const Vect3 &v) const |
Vect3 | Sub (const Vect3 &v) const |
Vect3 | Neg () const |
Vect3 | Scal (double k) const |
double | dot (const double x, const double y, const double z) const |
double | dot (const Vect3 &v) const |
double | sqv () const |
double | norm () const |
double | det2D (const Vect3 &v) const |
double | dot2D (const Vect3 &v) const |
double | sqv2D () const |
double | norm2D () const |
Vect3 | Hat2D () const |
double | cyl_norm (const double d, const double h) const |
double | distanceH (const Vect3 &w) const |
double | distanceV (const Vect3 &w) const |
std::string | toString () const |
std::string | toString (int precision) const |
std::string | toStringNP (const std::string &xunit, const std::string &yunit, const std::string &zunit) const |
std::string | toStringNP (const std::string &xunit, const std::string &yunit, const std::string &zunit, int precision) const |
std::string | formatXYZ (const std::string &pre, const std::string &mid, const std::string &post) const |
std::string | formatXYZ (int prec, const std::string &pre, const std::string &mid, const std::string &post) const |
std::string | toPVS () const |
std::string | toPVS (int precision) const |
bool | isInvalid () const |
Static Public Member Functions | |
static Velocity | make (const Vect3 &v) |
static Velocity | make (const Vect2 &v) |
static Velocity | mkVxyz (const double vx, const double vy, const double vz) |
static Velocity | makeVxyz (const double vx, const double vy, const double vz) |
static Velocity | makeVxyz (const double vx, const double vy, const std::string &uvxy, const double vz, const std::string &uvz) |
static Velocity | mkTrkGsVs (const double trk, const double gs, const double vs) |
static Velocity | makeTrkGsVs (const double trk, const double gs, const double vs) |
static Velocity | makeTrkGsVs (const double trk, const std::string &utrk, const double gs, const std::string &ugs, const double vs, const std::string &uvs) |
static Velocity | mkVel (const Vect3 &p1, const Vect3 &p2, double speed) |
static double | track (const Vect3 &p1, const Vect3 &p2) |
static Velocity | genVel (const Vect3 &p1, const Vect3 &p2, double dt) |
static const Velocity & | ZEROV () |
static const Velocity & | INVALIDV () |
static double | trkgs2vx (double trk, double gs) |
static double | trkgs2vy (double trk, double gs) |
static Vect2 | trkgs2v (double trk, double gs) |
static Velocity | parseXYZ (const std::string &str) |
static Velocity | parse (const std::string &str) |
![]() | |
static Vect3 | mk (double x, double y, double z) |
static Vect3 | makeXYZ (double x, std::string ux, double y, std::string uy, double z, std::string uz) |
static Vect3 | mkXYZ (double x, double y, double z) |
static Vect3 | make (double x, double y, double z) |
static Vect3 | make (double x, const std::string &xunits, double y, const std::string &yunits, double z, const std::string &zunits) |
static double | tcpa (const Vect3 &so, const Vect3 &vo, const Vect3 &si, const Vect3 &vi) |
static const Vect3 & | ZERO () |
static const Vect3 & | INVALID () |
static Vect3 | parse (const std::string &s) |
Private Member Functions | |
Velocity (const double vx, const double vy, const double vz) | |
Additional Inherited Members | |
![]() | |
double | x |
double | y |
double | z |
This class represents a 3-dimensional velocity vector. The components of the vector represent East-North-Up (ENU) coordinates; thus x is positive in the east direction, y is positive in the north, and z is positive up. The other right handed coordinate system, East-North-Down can probably be used without error, but this has not be tested very well. The track angle is defined by the "true north, clockwise convention."
|
private |
Instantiates a new velocity in internal units.
vx | the vx |
vy | the vy |
vz | the vz |
larcfm::Velocity::Velocity | ( | ) |
Instantiates a zero velocity.
double larcfm::Velocity::angle | ( | ) | const |
Angle in radians in the range [-Math.PI
, Math.PI
]. Convention is counter-clockwise with respect to east.
double larcfm::Velocity::angle | ( | const std::string & | uangle | ) | const |
Angle in explicit units in corresponding range [-Math.PI
, Math.PI
]. Convention is counter-clockwise with respect to east.
uangle | the explicit units of track angle |
bool larcfm::Velocity::compare | ( | const Velocity & | v, |
double | horizDelta, | ||
double | vertDelta | ||
) |
Compare two velocities based on horizontal and vertical components. This could be used against a set of nacV ADS-B limits, for example.
v | other Velocity |
horizDelta | horizontal tolerance (absolute value) |
vertDelta | vertical tolerance (absolute value) |
bool larcfm::Velocity::compare | ( | const Velocity & | v, |
double | maxTrk, | ||
double | maxGs, | ||
double | maxVs | ||
) |
Compare Velocities: return true iff delta is within specified limits
v | the other velocity |
maxTrk | maximum track |
maxGs | maximum gs |
maxVs | maximum vs |
double larcfm::Velocity::compassAngle | ( | ) | const |
Compass angle in radians in the range [0
, 2*Math.PI
). Convention is clockwise with respect to north.
double larcfm::Velocity::compassAngle | ( | const std::string & | u | ) | const |
Compass angle in explicit units in corresponding range [0
, 2*Math.PI
). Convention is clockwise with respect to north.
u | the explicit units of compass angle |
Return the velocity if moving from p1 to p2 over the given time
p1 | first point |
p2 | second point |
dt | time |
double larcfm::Velocity::groundSpeed | ( | const std::string & | ugs | ) | const |
Ground speed in explicit units.
ugs | the explicit units of ground speed |
double larcfm::Velocity::gs | ( | ) | const |
Ground speed in internal units.
|
static |
An invalid velocity, used for error reporting
New velocity from Vect2 (setting the vertical speed to 0.0).
v | the 2-D velocity vector (in internal units). |
New velocity from Vect3 in internal units.
v | the 3-D velocity vector [mps,mps,mps] |
|
static |
New velocity from Track, Ground Speed, and Vertical speed in explicit units. Note that this uses trigonometric functions, and may introduce numeric instability.
trk | the track angle [deg] |
gs | the ground speed [knot] |
vs | the vertical speed [fpm] |
|
static |
New velocity from Track, Ground Speed, and Vertical speed in explicit units. Note that this uses trigonometric functions, and may introduce numeric instability.
trk | the track angle [utrk] |
utrk | the units of trk |
gs | the ground speed [ugs] |
ugs | the units of gs |
vs | the vertical speed [uvs] |
uvs | the units of vs |
|
static |
New velocity from Euclidean coordinates in "conventional" units.
vx | the x-velocity [knot] |
vy | the y-velocity [knot] |
vz | the z-velocity [fpm] |
|
static |
New velocity from Euclidean coordinates in explicit units.
vx | the x-velocity [uvxy] |
vy | the y-velocity [uvzy] |
uvxy | the units of vx and vy |
vz | the z-velocity [uvz] |
uvz | the units of vz |
Velocity larcfm::Velocity::mkAddTrk | ( | double | trk | ) | const |
New velocity from existing velocity by adding the given track angle to this vector's track angle. Essentially, this rotates the vector, a positive angle means a clockwise rotation.
trk | track angle [rad] |
Velocity larcfm::Velocity::mkGs | ( | double | gs_d | ) | const |
New velocity from existing velocity, changing only the ground speed
gs | ground speed [m/s] |
New velocity from existing velocity, changing only the ground speed
gs | [m/s] |
Velocity larcfm::Velocity::mkGs | ( | double | gs_d, |
std::string | u | ||
) | const |
New velocity from existing velocity, changing only the ground speed
gs | ground speed [u] |
u | units |
New velocity from existing velocity, changing only the ground speed
gs | [u] |
u | unit |
Velocity larcfm::Velocity::mkTrk | ( | double | trk | ) | const |
New velocity from existing velocity, changing only the track
trk | track angle [rad] |
Velocity larcfm::Velocity::mkTrk | ( | double | trk, |
std::string | u | ||
) | const |
New velocity from existing velocity, changing only the track
trk | track angle [u] |
u | units |
|
static |
New velocity from Track, Ground Speed, and Vertical speed in internal units. Note that this uses trigonometric functions, and may introduce numeric instability.
trk | the track angle [internal] |
gs | the ground speed [internal] |
vs | the vs [internal] |
Return the velocity along the line from p1 to p2 at the given speed
p1 | first point |
p2 | second point |
speed | speed [internal units] (composite 3 dimensional speed, Not ground or vertical speed!) |
Velocity larcfm::Velocity::mkVs | ( | double | vs | ) | const |
New velocity from existing velocity, changing only the vertical speed
vs | vertical speed [m/s] |
} New velocity from existing velocity, changing only the vertical speed
vs | [m/s] |
Velocity larcfm::Velocity::mkVs | ( | double | vs, |
std::string | u | ||
) | const |
New velocity from existing velocity, changing only the vertical speed
vs | vertical speed [u] |
u | units |
New velocity from existing velocity, changing only the vertical speed
vs | [u] |
u | units |
|
static |
New velocity from Euclidean coordinates in internal units.
vx | the x-velocity [internal] |
vy | the y-velocity [internal] |
vz | the z-velocity [internal] |
|
static |
This parses a space or comma-separated string as a Trk/Gs/Vs Velocity (an inverse to the toString method). If three bare values are present, then it is interpreted as degrees/knots/fpm. If there are 3 value/unit pairs then each values is interpreted wrt the appropriate unit. If the string cannot be parsed, an INVALID value is returned.
str | string to parse |
This parses a space or comma-separated string as a Trk/Gs/Vs Velocity (an inverse to the toString method). If three bare values are present, then it is interpreted as degrees/knots/fpm. If there are 3 value/unit pairs then each values is interpreted wrt the appropriate unit. If the string cannot be parsed, an INVALID value is returned.
|
static |
This parses a space or comma-separated string as a XYZ Velocity (an inverse to the toStringXYZ method). If three bare values are present, then it is interpreted as internal units. If there are 3 value/unit pairs then each values is interpreted wrt the appropriate unit. If the string cannot be parsed, an INVALID value is returned.
str | string to parse |
std::string larcfm::Velocity::toString | ( | ) | const |
String representation of the velocity in polar coordinates (compass angle and groundspeed)
std::string larcfm::Velocity::toString | ( | int | prec | ) | const |
String representation of the velocity in polar coordinates (compass angle and groundspeed) in [deg, knot, fpm]. This method does not output units.
prec | precision (0-15) |
std::vector< std::string > larcfm::Velocity::toStringList | ( | ) | const |
Return an array of string representing each value of the velocity in the units deg, knot, fpm.
std::vector< std::string > larcfm::Velocity::toStringList | ( | int | precision | ) | const |
Return an array of string representing each value of the velocity in the units deg, knot, fpm.
precision | the number of digits to display |
std::string larcfm::Velocity::toStringNP | ( | ) | const |
String representation, default number of decimal places, without parentheses
std::string larcfm::Velocity::toStringNP | ( | const std::string & | utrk, |
const std::string & | ugs, | ||
const std::string & | uvs, | ||
int | precision | ||
) | const |
String representation, with user-specified precision
precision | number of decimal places (0-15) |
utrk | units of track |
ugs | units of ground speed |
uvs | units of vertical speed |
std::string larcfm::Velocity::toStringNP | ( | int | precision | ) | const |
String representation, with user-specified precision
precision | number of decimal places (0-15) |
std::string larcfm::Velocity::toStringUnits | ( | ) | const |
String representation of the velocity in polar coordinates (compass angle and groundspeed)
std::string larcfm::Velocity::toStringUnits | ( | const std::string & | trkUnits, |
const std::string & | gsUnits, | ||
const std::string & | vsUnits | ||
) | const |
String representation (trk,gs,vs) with the given units
trkUnits | units for track |
gsUnits | units for ground speed |
vsUnits | units for vertical speed |
std::string larcfm::Velocity::toStringXYZ | ( | ) | const |
Euclidean vector representation to arbitrary precision, in [knot,knot,fpm]
std::vector< std::string > larcfm::Velocity::toStringXYZList | ( | ) | const |
Return an array of string representing each value of the velocity in terms of its Cartesian dimensions in units knot, knot, fpm.
std::vector< std::string > larcfm::Velocity::toStringXYZList | ( | int | precision | ) | const |
Return an array of string representing each value of the velocity in terms of its Cartesian dimensions in units knot, knot, fpm.
precision | the number of digits to display |
double larcfm::Velocity::track | ( | const std::string & | utrk | ) | const |
Track angle in explicit units in the corresponding range [-Math.PI
, Math.PI
]. Convention is clockwise with respect to north.
utrk | the explicit units of track angle |
Return the track along the line from p1 to p2 at the given speed
p1 | first point |
p2 | second point |
double larcfm::Velocity::trk | ( | ) | const |
Track angle in radians in the range [-Math.PI
, Math.PI
]. Convention is clockwise with respect to north.
|
static |
Return the 2-dimensional Euclidean vector for velocity given the track and ground speed. The track angle is assumed to use the radians from true North-clockwise convention.
trk | track |
gs | ground speed |
|
static |
Return the x component of velocity given the track and ground speed. The track angle is assumed to use the radians from true North-clockwise convention.
trk | track angle |
gs | ground speed |
|
static |
Return the y component of velocity given the track and ground speed. The track angle is assumed to use the radians from true North-clockwise convention.
trk | track |
gs | ground speed |
double larcfm::Velocity::verticalSpeed | ( | const std::string & | uvs | ) | const |
Vertical speed in explicit units.
uvs | the explicit units of vertical speed |
double larcfm::Velocity::vs | ( | ) | const |
Vertical speed in internal units.
Velocity larcfm::Velocity::zeroSmallVs | ( | double | threshold | ) | const |
If the z component of the velocity vector is smaller than the threshold, return a new vector with this component set to 0. Return the original vector if the vertical speed is greater than the threshold.
threshold | level of vertical speed below which the vector is altered |
|
static |
Return a zero velocity vector