ICAROUS
All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Modules Pages
Public Member Functions | Static Public Member Functions | List of all members
larcfm::Point Class Reference

#include <Point.h>

Inheritance diagram for larcfm::Point:
larcfm::Vect3 larcfm::OutputList

Public Member Functions

 Point (double x, double y, double z)
 
Point mkX (double X) const
 
Point mkY (double Y) const
 
Point mkZ (double Z) const
 
Point Hat () const
 
Point Neg () const
 
Point Add (const Point &v) const
 
Point Sub (const Point &v) const
 
Point Scal (double k) const
 
Point linear (const Velocity &v, double t) const
 
std::string toString () const
 
std::string toString (int prec, const std::string &xUnits, const std::string &yUnits, const std::string &zUnits) const
 
std::string toStringUnits (const std::string &xUnits, const std::string &yUnits, const std::string &zUnits) const
 
std::vector< std::string > toStringList () const
 
std::string toStringNP () const
 
std::string toStringNP (int precision) const
 
std::string toStringNP (int precision, const std::string &xUnits, const std::string &yUnits, const std::string &zUnits) const
 
- Public Member Functions inherited from larcfm::Vect3
 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 const PointZEROP ()
 
static const PointINVALIDP ()
 
static Point mk (const Vect3 &v)
 
static Point mk (const Vect2 &v, double alt=0.0)
 
static Point mk (double x, double y, double z)
 
static Point make (double x, double y, double z)
 
static Point make (double x, const std::string &unitsX, double y, const std::string &unitsY, double z, const std::string &unitsZ)
 
static Point parse (const std::string &str)
 
- Static Public Member Functions inherited from larcfm::Vect3
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 Vect3ZERO ()
 
static const Vect3INVALID ()
 
static Vect3 parse (const std::string &s)
 

Additional Inherited Members

- Public Attributes inherited from larcfm::Vect3
double x
 
double y
 
double z
 

Detailed Description

This class represents a point or a 3-dimensional vector. This class contains methods to make the printing of Vect3's be more appropriate for a position (units of length), instead of the abstract Vect3 which has no natural units.

Constructor & Destructor Documentation

◆ Point()

Point::Point ( double  x,
double  y,
double  z 
)

Instantiates a new point in internal units.

Parameters
xthe x
ythe y
zthe z

Member Function Documentation

◆ INVALIDP()

const Point & Point::INVALIDP ( )
static

An invalid point, used for error reporting

◆ linear()

Point Point::linear ( const Velocity v,
double  t 
) const

Calculates position after t time units in direction and magnitude of velocity v

Parameters
vvelocity
ttime
Returns
the new position

◆ make() [1/2]

Point Point::make ( double  x,
const std::string &  unitsX,
double  y,
const std::string &  unitsY,
double  z,
const std::string &  unitsZ 
)
static

New point from Euclidean coordinates in the given units.

Parameters
xthe x-point
unitsXthe units for x
ythe y-point
unitsYthe units for y
zthe z-point
unitsZthe units for z
Returns
the point

◆ make() [2/2]

Point Point::make ( double  x,
double  y,
double  z 
)
static

New point from Euclidean coordinates in conventional units.

Parameters
xthe x-point [NM]
ythe y-point [NM]
zthe z-point [ft]
Returns
the point

◆ mk() [1/3]

Point Point::mk ( const Vect2 v,
double  alt = 0.0 
)
static

New point from Vect2 (setting the altitude to 0.0).

Parameters
vthe 2-D point vector (in internal units).
altthe altitude in internal units
Returns
the point

◆ mk() [2/3]

Point Point::mk ( const Vect3 v)
static

New point from Vect3.

Parameters
vthe 3-D point vector (in internal units).
Returns
the point

◆ mk() [3/3]

Point Point::mk ( double  x,
double  y,
double  z 
)
static

New point from Euclidean coordinates in internal units.

Parameters
xthe x-point [internal]
ythe y-point [internal]
zthe z-point [internal]
Returns
the point

◆ mkX()

Point Point::mkX ( double  X) const

New point from existing point, changing only the X

Parameters
Xnew X [internal units]
Returns
new point

◆ mkY()

Point Point::mkY ( double  Y) const

New point from existing point, changing only the Y

Parameters
Ynew Y [internal units]
Returns
new point

◆ mkZ()

Point Point::mkZ ( double  Z) const

New point from existing point, changing only the Z

Parameters
Znew Z [internal units]
Returns
new point

◆ parse()

Point Point::parse ( const std::string &  str)
static

This parses a space or comma-separated string as a Point (an inverse to the toString method). If three bare values are present, then it is interpreted as the default units for a point: [NM,NM,ft]. If there are 3 value/unit pairs then each values is interpreted with regard to the appropriate unit. If the string cannot be parsed, an INVALID value is returned.

Parameters
strstring to parse
Returns
point

◆ toString() [1/2]

std::string Point::toString ( ) const

String representation of the point in [NM, NM, ft]

◆ toString() [2/2]

std::string Point::toString ( int  prec,
const std::string &  xUnits,
const std::string &  yUnits,
const std::string &  zUnits 
) const

String representation of the point in the given units

Parameters
precprecision (0-15)
xUnitsunits for the x value
yUnitsunits for the y value
zUnitsunits for the z value
Returns
a string representing this point

◆ toStringList()

std::vector< std::string > Point::toStringList ( ) const
virtual

Return an array of string representing each value of the point in the units [NM,NM,ft]

Returns
array of strings

Implements larcfm::OutputList.

◆ toStringNP() [1/3]

std::string Point::toStringNP ( ) const

String representation, 4 decimal places, without parentheses

Returns
a string representing this point

◆ toStringNP() [2/3]

std::string Point::toStringNP ( int  precision) const

String representation, with user-specified precision

Parameters
precisionprecision (0-15)
Returns
a string representing this point

◆ toStringNP() [3/3]

std::string Point::toStringNP ( int  precision,
const std::string &  xUnits,
const std::string &  yUnits,
const std::string &  zUnits 
) const

String representation, with user-specified precision

Parameters
precisionprecision (0-15)
xUnitsunits for the x value
yUnitsunits for the y value
zUnitsunits for the z value
Returns
a string representing this point

◆ toStringUnits()

std::string Point::toStringUnits ( const std::string &  xUnits,
const std::string &  yUnits,
const std::string &  zUnits 
) const

String representation with the given units

Parameters
xUnitsunits for the x value
yUnitsunits for the y value
zUnitsunits for the z value
Returns
a string representing this point

◆ ZEROP()

const Point & Point::ZEROP ( )
static

Return a zero point vector


The documentation for this class was generated from the following files: