Go to the documentation of this file.
16 #ifndef SURGSIM_MATH_LINEARMOTIONARITHMETIC_H
17 #define SURGSIM_MATH_LINEARMOTIONARITHMETIC_H
132 T
atTime(
const T& t)
const;
155 template <
class T,
int N>
158 static_assert(N > 0,
"LinearMotion must have dimensionality > 0.");
179 LinearMotionND(
const std::array<T, N>& a,
const std::array<T, N>& b);
238 void getStart(std::array<T, N>* start)
const;
241 void getEnd(std::array<T, N>* end)
const;
288 LinearMotionND(
const std::array<T, 3>& start,
const std::array<T, 3>& end);
364 void getStart(std::array<T, 3>* start)
const;
367 void getEnd(std::array<T, 3>* end)
const;
377 Vector3 atTime(
const T& t)
const;
397 template <
typename T>
408 template <
typename T,
int N>
427 template <
class T,
int A>
499 #endif // SURGSIM_MATH_LINEARMOTIONARITHMETIC_H
bool operator!=(const LinearMotion< T > &m) const
Definition: LinearMotionArithmetic-inl.h:86
LinearMotion< T > & operator=(const LinearMotion< T > &m)
Assignment operator.
Definition: LinearMotionArithmetic-inl.h:40
IntervalND<T,3> defines the concept of a group of mathematical intervals specialized to 3 intervals a...
Definition: IntervalArithmetic.h:307
Polynomial< T, 1 > toPolynomial() const
Returns a linear expression (degree-1 polynomial) whose value for t=0..1 progresses from ‘start’ to ‘...
Definition: LinearMotionArithmetic-inl.h:62
Polynomial< T, 2 > analyticMagnitudeSquared(const LinearMotionND< T, 3 > &motion)
Calculate the magnitude squared of a linear motion 3 group as a polynomial.
Definition: LinearMotionArithmetic-inl.h:697
LinearMotion is (intentionally) a lot like Interval, but it deals with linear motion where all operan...
Definition: LinearMotionArithmetic.h:50
LinearMotion()
Constructor.
Definition: LinearMotionArithmetic-inl.h:25
void getEnd(std::array< T, N > *end) const
Definition: LinearMotionArithmetic-inl.h:325
std::array< LinearMotion< T >, N > m_motion
The N dimensional group of linear motions.
Definition: LinearMotionArithmetic.h:251
LinearMotionND<T, 3> specializes the LinearMotionND<T, N> class for 3 dimensions.
Definition: LinearMotionArithmetic.h:258
Interval< T > tripleProduct(const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b, const LinearMotionND< T, 3 > &c, const Interval< T > &range)
Calculate the triple product, as an interval.
LinearMotionND< T, N > & operator+=(const LinearMotionND< T, N > &m)
Definition: LinearMotionArithmetic-inl.h:258
T m_end
The end point of the linear motion.
Definition: LinearMotionArithmetic.h:145
IntervalND< T, N > operator*(const LinearMotionND< T, N > &m) const
Standard arithmetic operators extended to interval groups.
Definition: LinearMotionArithmetic-inl.h:286
bool containsZero() const
Definition: LinearMotionArithmetic-inl.h:68
LinearMotionND<T, N> defines the concept of a group of linear motions and provides operations on them...
Definition: LinearMotionArithmetic.h:156
Interval< T > operator*(const LinearMotion< T > &m) const
Standard arithmetic operators extended to interval groups.
Definition: LinearMotionArithmetic-inl.h:120
LinearMotionND< T, N > operator-(const LinearMotionND< T, N > &m) const
Definition: LinearMotionArithmetic-inl.h:268
Polynomial< T, 2 > analyticCrossProductXAxis(const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b)
Calculate the X axis of an analytic cross product as a Polynomial.
Definition: LinearMotionArithmetic-inl.h:647
bool operator==(const LinearMotionND< T, N > &motion) const
Definition: LinearMotionArithmetic-inl.h:238
Definition: CompoundShapeToGraphics.cpp:29
LinearMotion< T > secondHalf() const
Definition: LinearMotionArithmetic-inl.h:156
LinearMotion< T > operator-(const LinearMotion< T > &m) const
Definition: LinearMotionArithmetic-inl.h:106
const LinearMotion< T > & getAxis(int i) const
Definition: LinearMotionArithmetic-inl.h:309
IntervalND< T, N > operator/(const LinearMotionND< T, N > &m) const
Standard arithmetic operators extended to interval groups.
Definition: LinearMotionArithmetic-inl.h:292
void analyticCrossProduct(const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b, Polynomial< T, 2 > *resultXAxis, Polynomial< T, 2 > *resultYAxis, Polynomial< T, 2 > *resultZAxis)
Calculate an analytic cross product as a Polynomial.
Definition: LinearMotionArithmetic-inl.h:665
void getStart(std::array< T, N > *start) const
Definition: LinearMotionArithmetic-inl.h:316
Interval defines the concept of a mathematical interval and provides operations on it including arith...
Definition: IntervalArithmetic.h:34
Polynomial< T, 3 > analyticTripleProduct(const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b, const LinearMotionND< T, 3 > &c)
Calculate an analytic cross product as a Polynomial, as a polynomial whose value for t=0....
Definition: LinearMotionArithmetic-inl.h:674
std::ostream & operator<<(std::ostream &o, const Interval< T > &interval)
Write a textual version of the interval to an output stream.
Definition: IntervalArithmetic-inl.h:839
LinearMotionND< T, N > & operator=(const LinearMotionND< T, N > &motion)
Assignment operator.
Definition: LinearMotionArithmetic-inl.h:195
LinearMotionND()
Constructor.
Definition: LinearMotionArithmetic-inl.h:163
Interval< T > operator/(const LinearMotion< T > &m) const
Standard arithmetic operators extended to interval groups.
Definition: LinearMotionArithmetic-inl.h:126
IntervalND< T, N > toInterval() const
Convert from LinearMotion to an Interval.
Definition: LinearMotionArithmetic-inl.h:213
LinearMotionND< T, N > firstHalf() const
Definition: LinearMotionArithmetic-inl.h:334
Polynomial< T, 2 > analyticCrossProductAxis(const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b)
Calculate a single axis of an analytic cross product as a Polynomial.
Definition: LinearMotionArithmetic-inl.h:633
Polynomial<T, 1> specializes the Polynomial class for degree 1 (linear polynomials)
Definition: Polynomial.h:117
LinearMotionND< T, N > secondHalf() const
Definition: LinearMotionArithmetic-inl.h:345
LinearMotionND< T, N > & operator-=(const LinearMotionND< T, N > &m)
Definition: LinearMotionArithmetic-inl.h:276
IntervalND defines the concept of a group of mathematical intervals and provides operations on them i...
Definition: IntervalArithmetic.h:199
Polynomial< T, 2 > analyticDotProduct(const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b)
Calculate an analytic dot product as a Polynomial.
Definition: LinearMotionArithmetic-inl.h:625
std::array< LinearMotion< T >, 3 > m_motion
The 3 dimensional group of linear motions.
Definition: LinearMotionArithmetic.h:387
bool isApprox(const LinearMotionND< T, N > &motion, const T &epsilon) const
Definition: LinearMotionArithmetic-inl.h:225
Interval< T > dotProduct(const LinearMotionND< T, N > &motion) const
Definition: LinearMotionArithmetic-inl.h:298
Polynomial<T, 3> specializes the Polynomial class for degree 3 (cubic polynomials)
Definition: Polynomial.h:255
LinearMotionND< T, N > operator+(const LinearMotionND< T, N > &m) const
Definition: LinearMotionArithmetic-inl.h:250
Polynomial< T, 2 > analyticCrossProductZAxis(const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b)
Calculate the Z axis of an analytic cross product as a Polynomial.
Definition: LinearMotionArithmetic-inl.h:659
bool isApprox(const LinearMotion< T > &i, const T &epsilon) const
Definition: LinearMotionArithmetic-inl.h:74
Eigen::Matrix< T, 3, 1 > Vector3
Typedef for a vector 3 return.
Definition: LinearMotionArithmetic.h:262
bool operator!=(const LinearMotionND< T, N > &motion) const
Definition: LinearMotionArithmetic-inl.h:244
T m_start
The start point of the linear motion.
Definition: LinearMotionArithmetic.h:142
bool operator==(const LinearMotion< T > &m) const
Definition: LinearMotionArithmetic-inl.h:80
LinearMotion< T > operator+(const LinearMotion< T > &m) const
Definition: LinearMotionArithmetic-inl.h:92
T getStart() const
Definition: LinearMotionArithmetic-inl.h:132
LinearMotion< T > & operator+=(const LinearMotion< T > &m)
Definition: LinearMotionArithmetic-inl.h:98
Interval< T > toInterval() const
Convert from LinearMotion to an Interval.
Definition: LinearMotionArithmetic-inl.h:56
LinearMotion< T > & operator-=(const LinearMotion< T > &m)
Definition: LinearMotionArithmetic-inl.h:112
Polynomial< T, 2 > analyticCrossProductYAxis(const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b)
Calculate the Y axis of an analytic cross product as a Polynomial.
Definition: LinearMotionArithmetic-inl.h:653
LinearMotion< T > firstHalf() const
Definition: LinearMotionArithmetic-inl.h:150
Polynomial<T, 2> specializes the Polynomial class for degree 2 (quadratic polynomials)
Definition: Polynomial.h:183
T getEnd() const
Definition: LinearMotionArithmetic-inl.h:138
T atTime(const T &t) const
Definition: LinearMotionArithmetic-inl.h:144