36 template<
typename Type>
39 template<
typename Type>
42 template<
typename Type>
45 template<
typename Type>
48 template<
typename Type>
57 template<
typename Type>
97 template<
typename Type>
2D line segment - Integer
Definition: line_segment.h:177
LineSegment2()
Definition: line_segment.h:179
LineSegment2(const Vec2< int > &point_p, const Vec2< int > &point_q)
Definition: line_segment.h:181
LineSegment2(const LineSegment2x< int > ©)
Definition: line_segment.h:180
2D line segment - Double
Definition: line_segment.h:199
LineSegment2d(const Vec2< double > &point_p, const Vec2< double > &point_q)
Definition: line_segment.h:203
LineSegment2d()
Definition: line_segment.h:201
LineSegment2d(const LineSegment2x< double > ©)
Definition: line_segment.h:202
2D line segment - Float
Definition: line_segment.h:188
LineSegment2f(const Vec2< float > &point_p, const Vec2< float > &point_q)
Definition: line_segment.h:192
LineSegment2f()
Definition: line_segment.h:190
LineSegment2f(const LineSegment2x< float > ©)
Definition: line_segment.h:191
2D line segment
Definition: line_segment.h:99
Type point_distance(const Vec2< Type > &point)
Return the distance from a point to a line.
Vec2< Type > p
Start point on the line.
Definition: line_segment.h:102
bool operator!=(const LineSegment2x< Type > &line) const
!= operator.
Definition: line_segment.h:170
LineSegment2x(const LineSegment2x< Type > ©)
Definition: line_segment.h:108
LineSegment2x()
Definition: line_segment.h:107
LineSegment2x(const Vec2< Type > &point_p, const Vec2< Type > &point_q)
Definition: line_segment.h:109
bool collinear(const LineSegment2x< Type > &second) const
Return true if two line segments are collinear. (All points are on the same line.)
LineSegment2x< Type > & clip(const Rectx< Type > &rect, bool &clipped)
Clip this line to a rectangle.
LineSegment2x< Type > & operator=(const LineSegment2x< Type > ©)
= operator.
Definition: line_segment.h:164
bool intersects(const LineSegment2x< Type > &second, bool collinear_intersect) const
Return true if two line segments intersect.
Vec2< Type > get_midpoint() const
Get the midpoint of this line.
Definition: line_segment.h:114
Type point_right_of_line(const Vec2< Type > &point) const
Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B.
Definition: line_segment.h:145
bool operator==(const LineSegment2x< Type > &line) const
== operator.
Definition: line_segment.h:167
Vec2< Type > normal() const
Return the normal vector of the line from point A to point B.
Vec2< Type > get_intersection(const LineSegment2x< Type > &second, bool &intersect) const
Return the intersection point of two lines.
Vec2< Type > q
Definition: line_segment.h:105
3D line segment - Integer
Definition: line_segment.h:210
LineSegment3()
Definition: line_segment.h:212
LineSegment3(const LineSegment3x< int > ©)
Definition: line_segment.h:213
LineSegment3(const Vec3< int > &point_p, const Vec3< int > &point_q)
Definition: line_segment.h:214
3D line segment - Double
Definition: line_segment.h:232
LineSegment3d(const Vec3< double > &point_p, const Vec3< double > &point_q)
Definition: line_segment.h:236
LineSegment3d(const LineSegment3x< double > ©)
Definition: line_segment.h:235
LineSegment3d()
Definition: line_segment.h:234
3D line segment - Float
Definition: line_segment.h:221
LineSegment3f(const LineSegment3x< float > ©)
Definition: line_segment.h:224
LineSegment3f(const Vec3< float > &point_p, const Vec3< float > &point_q)
Definition: line_segment.h:225
LineSegment3f()
Definition: line_segment.h:223
3D line segment
Definition: line_segment.h:59
LineSegment3x< Type > & operator=(const LineSegment3x< Type > ©)
= operator.
Definition: line_segment.h:84
Vec3< Type > get_midpoint() const
Get the midpoint of this line.
Definition: line_segment.h:74
Type point_distance(const Vec3< Type > &point, Vec3< Type > &dest_intercept) const
Calculate the distance from a line segment to a point.
LineSegment3x()
Definition: line_segment.h:67
bool operator==(const LineSegment3x< Type > &line) const
== operator.
Definition: line_segment.h:87
LineSegment3x(const LineSegment3x< Type > ©)
Definition: line_segment.h:68
LineSegment3x(const Vec3< Type > &point_p, const Vec3< Type > &point_q)
Definition: line_segment.h:69
Vec3< Type > p
Start point on the line.
Definition: line_segment.h:62
bool operator!=(const LineSegment3x< Type > &line) const
!= operator.
Definition: line_segment.h:90
Vec3< Type > q
Definition: line_segment.h:65
2D (left,top,right,bottom) rectangle structure.
Definition: rect.h:51
2D vector
Definition: vec2.h:76
3D vector
Definition: vec3.h:75