12 #include <matrix/LibMatrix.h>
51 inline void getLine( T& x1, T& y1, T& x2, T& y2 )
const;
52 inline void setLine( T x1, T y1, T x2, T y2 );
74 inline T
angle()
const;
110 : myStartPoint(orig.myStartPoint)
111 , myEndPoint(orig.myEndPoint)
141 myStartPoint = point;
191 return myEndPoint.x - myStartPoint.x;
197 return myEndPoint.y - myStartPoint.y;
203 return sqrt( lengthSquared() );
211 return ( dx * dx ) + ( dy * dy );
217 double rot = atan2( -dY(), dX() );
218 return DtModPerLo( static_cast<T>(rot), 0., M_2PI );
225 T ourAngle =
angle();
226 T theirAngle = line.
angle();
227 return DtModPerLo( (theirAngle - ourAngle), 0., M_2PI );
235 return DtVector2<T>( myStartPoint.x + ( dx * t ), myStartPoint.y + ( dy * t ) );
T dX() const
Get the difference between x2 and x1.
Definition: DtLine2D.h:189
void getPoints(DtVector2< T > &p1, DtVector2< T > &p2) const
Get / set the line as points.
Definition: DtLine2D.h:175
T dY() const
Get the different between y2 and y1.
Definition: DtLine2D.h:195
void setPoints(const DtVector2< T > &p1, const DtVector2< T > &p2)
Definition: DtLine2D.h:182
DtVector2< T > pointAt(T t)
Get the point along the line at the parametric value supplied (between 0. and 1. inclusive) ...
Definition: DtLine2D.h:231
DtLine2D< T > & operator=(const DtLine2D< T > &rhs)
Definition: DtLine2D.h:117
DtVector2< T > endPoint() const
Get / set the ending point of the line.
Definition: DtLine2D.h:145
DtLine2D class DtLine2D is a templated class (typically for doing floats vs. doubles) used to represe...
Definition: DtLine2D.h:22
void setEndPoint(const DtVector2< T > &point)
Get / set the ending point of the line.
Definition: DtLine2D.h:151
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
T angle() const
Get the angle that the line makes with the horizontal, in radians.
Definition: DtLine2D.h:215
void setStartPoint(const DtVector2< T > &point)
Get / set the starting point of the line.
Definition: DtLine2D.h:139
T length() const
Get the length of the line.
Definition: DtLine2D.h:201
void setLine(T x1, T y1, T x2, T y2)
Definition: DtLine2D.h:166
DtLine2D()
Unimplemented CTOR.
DtVector2< T > myStartPoint
Definition: DtLine2D.h:93
DtVector2< T > startPoint() const
Get / set the starting point of the line.
Definition: DtLine2D.h:133
DtVector2< T > myEndPoint
Definition: DtLine2D.h:94
void getLine(T &x1, T &y1, T &x2, T &y2) const
Definition: DtLine2D.h:157
T lengthSquared() const
Get the length of the line squared.
Definition: DtLine2D.h:207
virtual ~DtLine2D()
DTOR.
Definition: DtLine2D.h:128
T angleTo(const DtLine2D< T > &line) const
Get the angle that rotates this into into the same angle as the supplied line, in radians...
Definition: DtLine2D.h:223
2 dimensional vector
Definition: DtMath.h:20