24 # include <vcl_msvc_warnings.h> 64 #if 0 // use compiler defaults for these 70 {
set(
l.a(),
l.b(),
l.c());
return *
this; }
77 (
a()*
l.c()==
c()*
l.a() &&
b()*
l.c()==
c()*
l.b() &&
b()*
l.a()==
a()*
l.b());
97 inline Type
a()
const {
return a_;}
99 inline Type
b()
const {
return b_;}
101 inline Type
c()
const {
return c_;}
117 inline void set(Type ta, Type tb, Type tc) { assert(ta||tb);
a_=ta;
b_=tb;
c_=tc; }
121 inline bool ideal(Type = (Type)0)
const {
return false; }
130 #define l vgl_line_2d<Type> 134 template <
class Type>
inline 135 bool is_ideal(
l const&, Type = (Type)0) {
return false; }
139 template <
class Type>
inline 142 return l1.a()*(l2.b()*l3.c()-l3.b()*l2.c())
143 +l2.a()*(l3.b()*l1.c()-l1.b()*l3.c())
144 +l3.a()*(l1.b()*l2.c()-l2.b()*l1.c())==0;
149 template <
class Type>
150 std::ostream&
operator<<(std::ostream& s,
l const& line);
158 template <
class Type>
159 std::istream&
operator>>(std::istream& s,
l& line);
163 #define VGL_LINE_2D_INSTANTIATE(T) extern "please include vgl/vgl_line_2d.hxx first" 165 #endif // vgl_line_2d_h_
bool operator!=(vgl_line_2d< Type >const &other) const
Represents a homogeneous 2D line.
vgl_line_2d()
Default constructor (Line 1.y==0, the X axis).
void set(Type ta, Type tb, Type tc)
Set a b c.
bool concurrent(l const &l1, l const &l2, l const &l3)
Are three lines concurrent, i.e., do they pass through a common point?.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
bool operator==(vgl_line_2d< Type > const &l) const
the comparison operator.
bool normalize()
normalize the line coefficients s.t. a^2 + b^2 = 1.
bool ideal(Type=(Type) 0) const
Return true iff this line is the line at infinity.
Represents a Euclidean 2D line.
void get_two_points(vgl_point_2d< Type > &p1, vgl_point_2d< Type > &p2) const
Get two points on the line; normally the intersection with X and Y axes.
vgl_vector_2d< Type > normal() const
unit vector orthogonal to line.
vgl_line_2d(const Type v[3])
Construct from its equation, a 3-vector.
Type a() const
Parameter a of line a*x + b*y + c = 0.
bool is_ideal(l const &line, T tol=(T) 0)
Return true iff line is the line at infinity.
vgl_line_2d(Type ta, Type tb, Type tc)
Construct a vgl_line_2d from its equation, three Types.
direction vector in Euclidean 2D space
double slope_radians() const
angle with the horizontal line y=0, measured in radians.
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
Type b() const
Parameter b of line a*x + b*y + c = 0.
vgl_vector_2d< Type > direction() const
unit vector describing line direction.
Represents a cartesian 2D point.
Type c() const
Parameter c of line a*x + b*y + c = 0.
double slope_degrees() const
angle with the horizontal line y=0, measured in 360-degrees.
v normalized(v const &a)
Return a normalised version of a.