58 return pos + (
vel * (t - this->
t));
70 return std::isfinite(
pos) && std::isfinite(
vel) && std::isfinite(
t);
149 return (this->
pos == rhs.
pos) && (this->
vel == rhs.
vel) && (this->
t == rhs.
t);
175 void setFromPair(
double const posPair[2],
double t,
double deltaT,
bool isAngle) {
180 vel = (posPair[1] - posPair[0]) / deltaT;
197 bool polarFromXY(PVT &r, PVT &theta, PVT
const &x, PVT
const &y,
double tai);
208 void xyFromPolar(PVT &x, PVT &y, PVT
const &r, PVT
const &theta,
double tai);
228 void rot2D(PVT &rotX, PVT &rotY, PVT
const &x, PVT
const &y,
double ang,
double tai);
264 std::ostream &
operator<<(std::ostream &os, PVT
const &pvt);
PVT operator+(PVT const &rhs) const
PVT & operator+=(double const &rhs)
PVT operator-(PVT const &rhs) const
PVT copy(double t) const
Return a copy with a specified time.
void xyFromPolar(double &x, double &y, double r, double theta)
bool operator!=(PVT const &rhs)
double wrapCtr(double ang)
PVT operator/(double const &rhs) const
std::string __repr__() const
PVT(double pos, double vel, double t)
bool operator==(PVT const &rhs)
bool polarFromXY(double &r, double &theta, double x, double y)
void setFromPair(double const posPair[2], double t, double deltaT, bool isAngle)
PVT operator*(double const &rhs) const
void rot2D(double &rotX, double &rotY, double x, double y, double ang)
PVT copy() const
Return a copy.
double getPos(double t) const
Return the position at the specified time; return NaN if unknown.
PVT operator+(double const &rhs) const
PVT & operator-=(double const &rhs)
void invalidate(double t=DoubleNaN)
Set PVT invalid at the specified time (which defaults to NaN)
PVT & operator+=(PVT const &rhs)
std::ostream & operator<<(std::ostream &out, Coord const &coord)
bool isfinite() const
Are all values finite? (Does it have finite pos, vel and t)?
PVT operator-(double const &rhs) const
PVT & operator*=(double const &rhs)
double wrapPos(double ang)
PVT & operator-=(PVT const &rhs)
PVT & operator/=(double const &rhs)