クラス rcsc::Vector2D

2D point vector class [詳細]

#include <vector_2d.h>

すべてのメンバ一覧

Public メソッド

 Vector2D ()
 default constructor.
 Vector2D (const double &xx, const double &yy)
 create Vector with XY value directly.
bool valid () const
 check if this vector has validate values.
const Vector2Dassign (const double &xx, const double &yy)
 type conversion operator. alias of valid(). assign XY value directly.
const Vector2DsetPolar (const double &radius, const AngleDeg &dir)
 assign XY value from POLAR value.
const Vector2Dinvalidate ()
double r2 () const
 get the squared length of vector.
double r () const
 get the length of vector.
double length () const
 get the length of vector.
AngleDeg th () const
 get the angle of vector.
AngleDeg dir () const
 get the angle of vector.
Vector2D abs () const
 get new vector that XY values were set to absolute value.
double absX () const
 get absolute x value
double absY () const
 get absolute y value
const Vector2Dadd (const double &xx, const double &yy)
 add XY values respectively.
const Vector2Doperator+ () const
 return this vector
Vector2D operator- () const
 create reversed vector
const Vector2Doperator+= (const Vector2D &v)
 add vector to itself
const Vector2Doperator-= (const Vector2D &v)
 subtract vector to itself
const Vector2Doperator *= (const double &scalar)
 multiplied by 'scalar'
const Vector2Doperator/= (const double &scalar)
 divided by 'scalar'.
double dist2 (const Vector2D &p) const
 get the squared distance from this to 'p'.
double dist (const Vector2D &p) const
 get the distance from this to 'p'.
const Vector2DsetLength (const double &len)
 set vector length to 'len'.
Vector2D setLengthVector (const double &len) const
 get new vector that the length is set to 'len'
const Vector2Dnormalize ()
 normalize vector. length is set to 1.0.
Vector2D norm () const
 get new normalized vector that the length is set to 1.0 but angle is same
const Vector2Drotate (const double &deg)
 rotete this vector with 'deg'
const Vector2Drotate (const AngleDeg &angle)
 rotate this vector with 'angle'.
Vector2D rotatedVector (const double &deg) const
 get new vector that is rotated by 'deg'.
Vector2D rotatedVector (const AngleDeg &angle) const
 get new vector that is rotated by 'angle'.
const Vector2DsetDir (const AngleDeg &dir)
 set vector's angle to 'angle'
double innerProduct (const Vector2D &v) const
 get inner(dot) product with 'v'.
double outerProduct (const Vector2D &v) const
 get virtal outer(cross) product with 'v'.
std::ostream & print (std::ostream &os) const
 output XY values to ostream.
std::ostream & printRound (std::ostream &os, const double &prec=0.1) const
 output rounded XY values to ostream.

Static Public メソッド

static Vector2D polar2vector (const double &mag, const AngleDeg &theta)
 get new Vector created by POLAR value.
static Vector2D from_polar (const double &mag, const AngleDeg &theta)
 get new Vector created by POLAR value.
static double inner_product (const Vector2D &v1, const Vector2D &v2)
 get inner(dot) product for v1 and v2.
static double outer_product (const Vector2D &v1, const Vector2D &v2)
 get outer(cross) product for v1 and v2.

Public 変数

double x
 X coordinate
double y
 Y coordinate

Static Public 変数

static const double ERROR_VALUE
 constant error value for XY (= std::numeric_limits< doulble >::max()).
static const Vector2D INVALIDATED
 invalidated value vector

構成

class  AbsXCmp
 comparison predicate for absolute X value. [詳細]
class  AbsYCmp
 comparison predicate for absolute Y value. [詳細]
class  IsWithin
 template predicate for 2D region sign detection. [詳細]
class  XCmp
 comparison predicate for X value. [詳細]
class  YCmp
 comparison predicate for Y value. [詳細]


説明

2D point vector class


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

rcsc::Vector2D::Vector2D ( const double &  xx,
const double &  yy 
) [inline]

create Vector with XY value directly.

引数:
xx assigned x value
yy assigned x value


関数

bool rcsc::Vector2D::valid (  )  const [inline]

check if this vector has validate values.

戻り値:
true if value is validate.

const Vector2D& rcsc::Vector2D::assign ( const double &  xx,
const double &  yy 
) [inline]

type conversion operator. alias of valid(). assign XY value directly.

引数:
xx assigned x value
yy assigned y value
戻り値:
const reference to itself

const Vector2D& rcsc::Vector2D::setPolar ( const double &  radius,
const AngleDeg dir 
) [inline]

assign XY value from POLAR value.

引数:
radius vector's radius
dir vector's angle
戻り値:
const reference to itself

double rcsc::Vector2D::r2 (  )  const [inline]

get the squared length of vector.

戻り値:
squared length

double rcsc::Vector2D::r (  )  const [inline]

get the length of vector.

戻り値:
length

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

get the length of vector.

戻り値:
length

AngleDeg rcsc::Vector2D::th (  )  const [inline]

get the angle of vector.

戻り値:
angle

AngleDeg rcsc::Vector2D::dir (  )  const [inline]

get the angle of vector.

戻り値:
angle

Vector2D rcsc::Vector2D::abs (  )  const [inline]

get new vector that XY values were set to absolute value.

戻り値:
new vector that all values are absolute.

double rcsc::Vector2D::absX (  )  const [inline]

get absolute x value

戻り値:
absolute x value

double rcsc::Vector2D::absY (  )  const [inline]

get absolute y value

戻り値:
absolute y value

const Vector2D& rcsc::Vector2D::add ( const double &  xx,
const double &  yy 
) [inline]

add XY values respectively.

引数:
xx added x value
yy added y value
戻り値:
const reference to itself

const Vector2D& rcsc::Vector2D::operator+ (  )  const [inline]

return this vector

戻り値:
const reference of this vector

Vector2D rcsc::Vector2D::operator- (  )  const [inline]

create reversed vector

戻り値:
new vector that XY values are reversed.

const Vector2D& rcsc::Vector2D::operator+= ( const Vector2D v  )  [inline]

add vector to itself

引数:
v added vector
戻り値:
const reference to itself

const Vector2D& rcsc::Vector2D::operator-= ( const Vector2D v  )  [inline]

subtract vector to itself

引数:
v subtract argument
戻り値:
const reference to itself

const Vector2D& rcsc::Vector2D::operator *= ( const double &  scalar  )  [inline]

multiplied by 'scalar'

引数:
scalar multiplication argument
戻り値:
const reference to itself

const Vector2D& rcsc::Vector2D::operator/= ( const double &  scalar  )  [inline]

divided by 'scalar'.

引数:
scalar division argument
戻り値:
const reference to itself

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

get the squared distance from this to 'p'.

引数:
p target point
戻り値:
squared distance to 'p'

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

get the distance from this to 'p'.

引数:
p target point
戻り値:
distance to 'p'

const Vector2D& rcsc::Vector2D::setLength ( const double &  len  )  [inline]

set vector length to 'len'.

引数:
len new length to be set
戻り値:
const reference to itself

Vector2D rcsc::Vector2D::setLengthVector ( const double &  len  )  const [inline]

get new vector that the length is set to 'len'

引数:
len new length to be set
戻り値:
new vector that the length is set to 'len'

const Vector2D& rcsc::Vector2D::normalize (  )  [inline]

normalize vector. length is set to 1.0.

戻り値:
const reference to itself

Vector2D rcsc::Vector2D::norm (  )  const [inline]

get new normalized vector that the length is set to 1.0 but angle is same

戻り値:
new normalized vector

const Vector2D& rcsc::Vector2D::rotate ( const double &  deg  )  [inline]

rotete this vector with 'deg'

引数:
deg rotated angle by double type
戻り値:
const reference to itself

const Vector2D& rcsc::Vector2D::rotate ( const AngleDeg angle  )  [inline]

rotate this vector with 'angle'.

引数:
angle rotated angle
戻り値:
const reference to itself

Vector2D rcsc::Vector2D::rotatedVector ( const double &  deg  )  const [inline]

get new vector that is rotated by 'deg'.

引数:
deg rotated angle. double type.
戻り値:
new vector rotated by 'deg'

Vector2D rcsc::Vector2D::rotatedVector ( const AngleDeg angle  )  const [inline]

get new vector that is rotated by 'angle'.

引数:
angle rotated angle.
戻り値:
new vector rotated by 'angle'

const Vector2D& rcsc::Vector2D::setDir ( const AngleDeg dir  )  [inline]

set vector's angle to 'angle'

引数:
dir new angle to be set
戻り値:
const reference to itself

double rcsc::Vector2D::innerProduct ( const Vector2D v  )  const [inline]

get inner(dot) product with 'v'.

引数:
v target vector
戻り値:
value of inner product

double rcsc::Vector2D::outerProduct ( const Vector2D v  )  const [inline]

get virtal outer(cross) product with 'v'.

引数:
v target vector
戻り値:
value of outer product

static Vector2D rcsc::Vector2D::polar2vector ( const double &  mag,
const AngleDeg theta 
) [inline, static]

get new Vector created by POLAR value.

引数:
mag length of vector
theta angle of vector
戻り値:
new vector object

static Vector2D rcsc::Vector2D::from_polar ( const double &  mag,
const AngleDeg theta 
) [inline, static]

get new Vector created by POLAR value.

引数:
mag length of vector
theta angle of vector
戻り値:
new vector object

static double rcsc::Vector2D::inner_product ( const Vector2D v1,
const Vector2D v2 
) [inline, static]

get inner(dot) product for v1 and v2.

引数:
v1 input 1
v2 input 2
戻り値:
value of inner product

static double rcsc::Vector2D::outer_product ( const Vector2D v1,
const Vector2D v2 
) [inline, static]

get outer(cross) product for v1 and v2.

引数:
v1 input 1
v2 input 2
戻り値:
value of outer product

std::ostream& rcsc::Vector2D::print ( std::ostream &  os  )  const [inline]

output XY values to ostream.

引数:
os reference to ostream
戻り値:
reference to ostream

std::ostream& rcsc::Vector2D::printRound ( std::ostream &  os,
const double &  prec = 0.1 
) const [inline]

output rounded XY values to ostream.

引数:
os reference to ostream
prec precision of output value
戻り値:
reference to ostream


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