2 #ifndef vgl_line_segment_2d_h_ 3 #define vgl_line_segment_2d_h_ 17 # include <vcl_msvc_warnings.h> 104 template <
class Type>
107 #define VGL_LINE_SEGMENT_2D_INSTANTIATE(T) extern "please include vgl/vgl_line_segment_2d.hxx first" 109 #endif // vgl_line_segment_2d_h_ Represents a 2D line segment using two points.
Type b() const
Parameter b of line a*x + b*y + c = 0.
vgl_vector_2d< Type > normal() const
unit vector orthogonal to line.
bool operator==(vgl_line_segment_2d< Type > const &l) const
The equality comparison operator.
a point in 2D nonhomogeneous space
vgl_point_2d< Type > point1_
One end of line segment.
Type a() const
Parameter a of line a*x + b*y + c = 0.
double slope_degrees() const
angle with the oriented horizontal line y=0, measured in 360-degrees.
vgl_line_segment_2d(vgl_point_2d< Type > const &p1, vgl_point_2d< Type > const &p2)
Construct from two end points.
vgl_line_segment_2d(vgl_line_segment_2d< Type > const &l)
Copy constructor.
~vgl_line_segment_2d()=default
Destructor.
vgl_point_2d< Type > point2_
The other end of the line segment.
vgl_point_2d< Type > point_t(const double t) const
Return a point on the line defined by a scalar parameter t.
Type c() const
Parameter c of line a*x + b*y + c = 0.
vgl_point_2d< Type > point2() const
The other end-point of the line segment.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
bool operator!=(vgl_line_segment_2d< Type >const &other) const
The inequality comparison operator.
vgl_vector_2d< Type > direction() const
unit vector describing line direction.
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
double slope_radians() const
angle with the oriented horizontal line y=0, measured in radians.
Represents a cartesian 2D point.
void set(vgl_point_2d< Type > const &p1, vgl_point_2d< Type > const &p2)
Assignment.
vgl_line_segment_2d()=default
Default constructor - does not initialise!.
vgl_point_2d< Type > point1() const
One end-point of the line segment.