Go to the documentation of this file.
89 return (
getCCW(this->first, segment.first, this->second) !=
getCCW(this->first, segment.second, this->second) &&
90 getCCW(segment.first, this->first, segment.second) !=
getCCW(segment.first, this->second, segment.second));
102 JVector2D da(this->second - this->first);
103 JVector2D db(segment.second - segment.first);
155 return first.getDistanceSquared(point);
180 return JVector2D(this->second - this->first).
getDot(segment.second - segment.first);
194 in >> segment.second;
209 out << segment.first;
210 out << segment.second;
double getDistance(const JVector2D &point) const
Get distance to point.
double getDot(const JSegment2D &segment) const
Get dot product.
JVector2D & mul(const double factor)
Scale vector.
Interface for binary input.
JVector2D & div(const double factor)
Scale vector.
JSegment2D()
Default constructor.
double getLengthSquared() const
Get length squared.
bool intersects(const JSegment2D &segment) const
Test whether two line segments intersect.
Auxiliary classes and methods for 2D geometrical objects and operations.
JSegment2D(const JVector2D &A, const JVector2D &B)
Constructor.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double getLengthSquared() const
Get length squared.
double getLength() const
Get length.
Interface for binary output.
double getPerpDot(const JFirst_t &first, const JSecond_t &second)
Get perpendicular dot product of objects.
bool getCCW(const T &a, const T &b, const T &c)
Check sequence of three points in X-Y plane.
friend JReader & operator>>(JReader &in, JSegment2D &segment)
Read segment from input.
JVector2D & sub(const JVector2D &vector)
Subtract vector.
Exception for division by zero.
JVector2D getIntersection(const JSegment2D &segment) const
Get intersection of two line segments.
friend JWriter & operator<<(JWriter &out, const JSegment2D &segment)
Write segment to output.
double getDistanceSquared(const JVector2D &point) const
Get squared of distance to point.
std::pair< JPosition2D, JPosition2D > JSegment2D_t
Type definition of line segment in two dimensions.
Line segment in two dimensions.
double getDot(const JVector2D &point) const
Get dot product.
Data structure for vector in two dimensions.