クラス rcsc::Segment2D

2d segment line class [詳細]

#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 Segment2Dassign (const Vector2D &a, const Vector2D &b)
 construct from 2 points
const Segment2Dassign (const double &ax, const double &ay, const double &bx, const double &by)
 construct directly using raw coordinate values
const Segment2Dswap ()
 swap segment edge point
const Vector2Da () const
 get 1st point of segment edge
const Vector2Db () 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


説明

2d segment line class


コンストラクタとデストラクタ

rcsc::Segment2D::Segment2D ( const Vector2D a,
const Vector2D b 
) [inline]

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


関数

const Segment2D& rcsc::Segment2D::assign ( const Vector2D a,
const Vector2D b 
) [inline]

construct from 2 points

引数:
a first point
b second point
戻り値:
const reference to itself

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 reference to itself

const Vector2D& rcsc::Segment2D::a (  )  const [inline]

get 1st point of segment edge

戻り値:
vector object

const Vector2D& rcsc::Segment2D::b (  )  const [inline]

get 2nd point of segment edge

戻り値:
vector object

Line2D rcsc::Segment2D::line (  )  const [inline]

get line generated from segment

戻り値:
new line object

double rcsc::Segment2D::length (  )  const [inline]

get the length of this segment

戻り値:
distance value

Line2D rcsc::Segment2D::perpendicularBisector (  )  const [inline]

make perpendicular bisector line from segment points

戻り値:
line object

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.

戻り値:
true if rectangle contains p

Vector2D rcsc::Segment2D::intersection ( const Segment2D other  )  const

check & get the intersection point with other line segment

引数:
other considered line segment
戻り値:
intersection point. if it does not exist, the invalidated value vector is returned.

Vector2D rcsc::Segment2D::intersection ( const Line2D other  )  const

check & get the intersection point with other line

引数:
other considered line
戻り値:
intersection point. if it does not exist, the invalidated value vector is returned.

bool rcsc::Segment2D::existIntersection ( const Segment2D other  )  const

check if segments cross each other or not.

引数:
other segment for cross checking
戻り値:
true if this segment crosses, otherwise returns false.

bool rcsc::Segment2D::existIntersectionExceptEndpoint ( const Segment2D other  )  const

check if segments intersect each other on non terminal point.

引数:
other segment for cross checking
戻り値:
true if this segments intersect and intersection point is not a terminal point of segment. false if segments not intersect or intersect on terminal point of segment.

Vector2D rcsc::Segment2D::nearestPoint ( const Vector2D p  )  const

get a point on segment where distance of point is minimal.

引数:
p point
戻り値:
nearest point on segment. if multiple nearest points found. returns one of them.

double rcsc::Segment2D::dist ( const Vector2D p  )  const

get minimum distance between this segment and point

引数:
p point
戻り値:
minimum distance between this segment and point

double rcsc::Segment2D::dist ( const Segment2D seg  )  const

get minimum distance between 2 segments

引数:
seg segment
戻り値:
minimum distance between 2 segments

double rcsc::Segment2D::farthestDist ( const Vector2D p  )  const

get maximum distance between this segment and point

引数:
p point
戻り値:
maximum distance between this segment and point


このクラスの説明は次のファイルから生成されました:
librcscに対してThu May 1 15:41:26 2008に生成されました。  doxygen 1.5.0