クラス rcsc::Line2D

2d straight line class [詳細]

#include <line_2d.h>

すべてのメンバ一覧

Public メソッド

 Line2D (const double &a, const double &b, const double &c)
 construct directly
 Line2D (const Vector2D &p1, const Vector2D &p2)
 construct from 2 points
 Line2D (const Vector2D &origin, const AngleDeg &linedir)
 construct from origin point + direction
const Line2Dassign (const Vector2D &p1, const Vector2D &p2)
 construct from 2 points
const Line2Dassign (const Vector2D &origin, const AngleDeg &linedir)
 construct from origin point + direction
const double & a () const
 accessor
const double & getA () const
 accessor
const double & b () const
 accessor
const double & getB () const
 accessor accessor
const double & c () const
 accessor
const double & getC () const
 accessor
double getX (const double &y) const
 get X-coordinate correspond to 'y'
double getY (const double &x) const
 get Y-coordinate correspond to 'x'
double dist (const Vector2D &p) const
 calculate distance from point to this line
double dist2 (const Vector2D &p) const
 get squared distance from this line to point
bool isParallel (const Line2D &line) const
 check if the slope of this line is same to the slope of 'line'
Vector2D intersection (const Line2D &line) const
 get the intersection point with 'line'
Line2D perpendicular (const Vector2D &p) const
 calc perpendicular line (SUI-SEN)
Vector2D projection (const Vector2D &p) const
 calc projection point from p

Static Public メソッド

static Vector2D intersection (const Line2D &line1, const Line2D &line2)
 get the intersection point of 2 lines
static Line2D angle_bisector (const Vector2D &origin, const AngleDeg &left, const AngleDeg &right)
 make angle bisector line from two angles
static Line2D perpendicular_bisector (const Vector2D &p1, const Vector2D &p2)
 make perpendicular bisector line from twt points

Static Public 変数

static const double EPSILON
static const double ERROR_VALUE
 epsilon value


説明

2d straight line class

Line Fomula: aX + bY + c = 0


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

rcsc::Line2D::Line2D ( const double &  a,
const double &  b,
const double &  c 
) [inline]

construct directly

引数:
a Line formula A, coefficient for x
b Line formula B, coefficient for y
c constant C

rcsc::Line2D::Line2D ( const Vector2D p1,
const Vector2D p2 
) [inline]

construct from 2 points

引数:
p1 first point
p2 second point

rcsc::Line2D::Line2D ( const Vector2D origin,
const AngleDeg linedir 
) [inline]

construct from origin point + direction

引数:
origin origin point
linedir direction from origin point


関数

const Line2D& rcsc::Line2D::assign ( const Vector2D p1,
const Vector2D p2 
) [inline]

construct from 2 points

引数:
p1 first point
p2 second point
戻り値:
const reference to itself

const Line2D& rcsc::Line2D::assign ( const Vector2D origin,
const AngleDeg linedir 
) [inline]

construct from origin point + direction

引数:
origin origin point
linedir direction from origin point
戻り値:
const reference to itself

const double& rcsc::Line2D::a (  )  const [inline]

accessor

戻り値:
coefficient 'A' of line formula

const double& rcsc::Line2D::getA (  )  const [inline]

accessor

戻り値:
coefficient 'A' of line formula

const double& rcsc::Line2D::b (  )  const [inline]

accessor

戻り値:
coefficient 'B' of line formula

const double& rcsc::Line2D::getB (  )  const [inline]

accessor accessor

戻り値:
coefficient 'B' of line formula

const double& rcsc::Line2D::c (  )  const [inline]

accessor

戻り値:
coefficient 'C' of line formula

const double& rcsc::Line2D::getC (  )  const [inline]

accessor

戻り値:
coefficient 'C' of line formula

double rcsc::Line2D::getX ( const double &  y  )  const [inline]

get X-coordinate correspond to 'y'

引数:
y considered Y
戻り値:
X coordinate

double rcsc::Line2D::getY ( const double &  x  )  const [inline]

get Y-coordinate correspond to 'x'

引数:
x considered X
戻り値:
Y coordinate

double rcsc::Line2D::dist ( const Vector2D p  )  const [inline]

calculate distance from point to this line

引数:
p considrered point
戻り値:
distance value

double rcsc::Line2D::dist2 ( const Vector2D p  )  const [inline]

get squared distance from this line to point

引数:
p considrered point
戻り値:
squared distance value

bool rcsc::Line2D::isParallel ( const Line2D line  )  const [inline]

check if the slope of this line is same to the slope of 'line'

引数:
line considered line
戻り値:
true almost same
false not same

Vector2D rcsc::Line2D::intersection ( const Line2D line  )  const [inline]

get the intersection point with 'line'

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

Line2D rcsc::Line2D::perpendicular ( const Vector2D p  )  const [inline]

calc perpendicular line (SUI-SEN)

引数:
p the point that perpendicular line pass through
戻り値:
perpendicular line

Vector2D rcsc::Line2D::projection ( const Vector2D p  )  const [inline]

calc projection point from p

引数:
p base point
戻り値:
projection point

Vector2D rcsc::Line2D::intersection ( const Line2D line1,
const Line2D line2 
) [static]

get the intersection point of 2 lines

引数:
line1 the first line
line2 the second line
戻り値:
the intersection point. if no intersection, invalid vector is returned.

static Line2D rcsc::Line2D::angle_bisector ( const Vector2D origin,
const AngleDeg left,
const AngleDeg right 
) [inline, static]

make angle bisector line from two angles

引数:
origin origin point that is passed through by result line
left left angle
right right angle
戻り値:
line object

Line2D rcsc::Line2D::perpendicular_bisector ( const Vector2D p1,
const Vector2D p2 
) [static]

make perpendicular bisector line from twt points

引数:
p1 1st point
p2 2nd point
戻り値:
line object


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