#include <segment_2d.h>
Public メソッド | |
Segment2D (const Vector2D &a, const Vector2D &b) | |
construct from 2 points | |
Segment2D (const double &ax, const double &ay, const double &bx, const double &by) | |
construct directly using raw coordinate values | |
const Segment2D & | assign (const Vector2D &a, const Vector2D &b) |
construct from 2 points | |
const Segment2D & | assign (const double &ax, const double &ay, const double &bx, const double &by) |
construct directly using raw coordinate values | |
const Segment2D & | swap () |
swap segment edge point | |
const Vector2D & | a () const |
get 1st point of segment edge | |
const Vector2D & | b () const |
get 2nd point of segment edge | |
Line2D | line () const |
get line generated from segment | |
double | length () const |
get the length of this segment | |
Line2D | perpendicularBisector () const |
make perpendicular bisector line from segment points | |
bool | contains (const Vector2D &p) const |
check if the point is within the rectangle defined by this segment as a diagonal line. | |
Vector2D | intersection (const Segment2D &other) const |
check & get the intersection point with other line segment | |
Vector2D | intersection (const Line2D &other) const |
check & get the intersection point with other line | |
bool | existIntersection (const Segment2D &other) const |
check if segments cross each other or not. | |
bool | existIntersectionExceptEndpoint (const Segment2D &other) const |
check if segments intersect each other on non terminal point. | |
Vector2D | nearestPoint (const Vector2D &p) const |
get a point on segment where distance of point is minimal. | |
double | dist (const Vector2D &p) const |
get minimum distance between this segment and point | |
double | dist (const Segment2D &seg) const |
get minimum distance between 2 segments | |
double | farthestDist (const Vector2D &p) const |
get maximum distance between this segment and point | |
bool | onSegment (const Vector2D &p) const |
construct from 2 points
a | 1st point of segment edge | |
b | 2nd point of segment edge |
rcsc::Segment2D::Segment2D | ( | const double & | ax, | |
const double & | ay, | |||
const double & | bx, | |||
const double & | by | |||
) | [inline] |
construct directly using raw coordinate values
ax | 1st point x value of segment edge | |
ay | 1st point x value of segment edge | |
bx | 1st point y value of segment edge | |
by | 1st point y value of segment edge |
construct from 2 points
a | first point | |
b | second point |
const Segment2D& rcsc::Segment2D::assign | ( | const double & | ax, | |
const double & | ay, | |||
const double & | bx, | |||
const double & | by | |||
) | [inline] |
construct directly using raw coordinate values
ax | 1st point x value of segment edge | |
ay | 1st point x value of segment edge | |
bx | 1st point y value of segment edge | |
by | 1st point y value of segment edge |
const Segment2D& rcsc::Segment2D::swap | ( | ) | [inline] |
swap segment edge point
const Vector2D& rcsc::Segment2D::a | ( | ) | const [inline] |
get 1st point of segment edge
const Vector2D& rcsc::Segment2D::b | ( | ) | const [inline] |
get 2nd point of segment edge
Line2D rcsc::Segment2D::line | ( | ) | const [inline] |
get line generated from segment
double rcsc::Segment2D::length | ( | ) | const [inline] |
get the length of this segment
Line2D rcsc::Segment2D::perpendicularBisector | ( | ) | const [inline] |
make perpendicular bisector line from segment points
bool rcsc::Segment2D::contains | ( | const Vector2D & | p | ) | const [inline] |
check if the point is within the rectangle defined by this segment as a diagonal line.
check & get the intersection point with other line segment
other | considered line segment |
check & get the intersection point with other line
other | considered line |
bool rcsc::Segment2D::existIntersection | ( | const Segment2D & | other | ) | const |
check if segments cross each other or not.
other | segment for cross checking |
bool rcsc::Segment2D::existIntersectionExceptEndpoint | ( | const Segment2D & | other | ) | const |
check if segments intersect each other on non terminal point.
other | segment for cross checking |
get a point on segment where distance of point is minimal.
p | point |
double rcsc::Segment2D::dist | ( | const Vector2D & | p | ) | const |
get minimum distance between this segment and point
p | point |
double rcsc::Segment2D::dist | ( | const Segment2D & | seg | ) | const |
get minimum distance between 2 segments
seg | segment |
double rcsc::Segment2D::farthestDist | ( | const Vector2D & | p | ) | const |
get maximum distance between this segment and point
p | point |