|
User Documentation |
|
Centre for Vision, Speech & Signal Processing |
|
PUBLIC |
Vector3dC::Vector3dC(void)
Vector3dC::Vector3dC(CoordT,CoordT,CoordT)
Vector3dC::Vector3dC(const Point3dC &)
Vector3dC::Vector3dC(const Vector3dC &)
Vector3dC::Vector3dC(const Point3dC &,const Point3dC &)
Vector3dC::Vector3dC(const AngleT,const AngleT)
Vector3dC::Vector3dC(istream &)
Vector3dC::Vector3dC(const VectorC &)
Vector3dC::Vector(void) const
Vector3dC::Vector(void)
Vector3dC::SetZero(void)
Vector3dC::operator-(void) const
Vector3dC::operator+(const Vector3dC &) const
Vector3dC::operator-(const Vector3dC &) const
Vector3dC::operator*(const RealT) const
Vector3dC::operator*(const Vector3dC &) const
Vector3dC::operator/(const RealT) const
Vector3dC::operator/(const Point3dC &) const
Vector3dC::operator+=(const Vector3dC &)
Vector3dC::operator-=(const Vector3dC &)
Vector3dC::operator*=(const RealT)
Vector3dC::operator/=(const RealT)
Vector3dC::operator&(const Vector3dC &) const
Vector3dC::operator%(const Vector3dC &) const
Vector3dC::Dot(const Vector3dC &) const
Vector3dC::Cross(const Vector3dC &) const
Vector3dC::Cross3(const Vector3dC &) const
Vector3dC::TripleScalar(const Vector3dC &,const Vector3dC &) const
Vector3dC::Norm(void) const
Vector3dC::SqrNorm(void) const
Vector3dC::Modulus(void) const
Vector3dC::Unit(void) const
Vector3dC::MakeUnit(void)
Vector3dC::MakeUnit(IndexT)
Vector3dC::ProjectionSizeInto(const Vector3dC &) const
Vector3dC::ProjectionInto(const Vector3dC &) const
Vector3dC::Angle(const Vector3dC &) const
Vector3dC::RotationX(const RealT) const
Vector3dC::RotationY(const RealT) const
Vector3dC::RotationZ(const RealT) const
Vector3dC::Rotation(const Vector3dC &,const RealT) const
Vector3dC::ProductT(void) const
Vector3dC::operator*(RealT,const Vector3dC &)
Vector3dC::operator<<(ostream &,const Vector3dC &)
Vector3dC::operator>>(istream &,Vector3dC &)
Point3dC::Point3dC(SizeT)
Point3dC::operator=(const Point3dC &)
Point3dC::operator[](IndexT) const
Point3dC::operator[](IndexT)
Point3dC::X(void)
Point3dC::Y(void)
Point3dC::Z(void)
Point3dC::X(void) const
Point3dC::Y(void) const
Point3dC::Z(void) const
Point3dC::Point(void) const
Point3dC::Point(void)
Point3dC::operator==(const Point3dC &) const
Point3dC::operator!=(const Point3dC &) const
Point3dC::operator>(const Point3dC &) const
Point3dC::OneBigger(const Point3dC &) const
Point3dC::SetZero(void)
Point3dC::Set(const Point3dC &)
Point3dC::Set(const CoordT,const CoordT,const CoordT)
Point3dC::SetMinimum(const Point3dC &)
Point3dC::SetMaximum(const Point3dC &)
Point3dC::MinIndex(void) const
Point3dC::MaxIndex(void) const
Point3dC::AbsMinIndex(void) const
Point3dC::AbsMaxIndex(void) const
Point3dC::Min(void) const
Point3dC::Max(void) const
Point3dC::operator+=(const Point3dC &)
Point3dC::operator-=(const Point3dC &)
Point3dC::operator*=(const Point3dC &)
Point3dC::operator/=(const Point3dC &)
Point3dC::operator*=(const RealT)
Point3dC::operator/=(const RealT)
Point3dC::operator+(const Point3dC &) const
Point3dC::operator-(const Point3dC &) const
Point3dC::operator*(const Point3dC &) const
Point3dC::operator/(const Point3dC &) const
Point3dC::operator*(const RealT) const
Point3dC::operator/(const RealT) const
Point3dC::operator+(const Vector3dC &) const
Point3dC::operator&(const Point3dC &) const
Point3dC::Translation(const Point3dC &) const
Point3dC::SqrEuclidDistance(const Point3dC &) const
Point3dC::EuclidDistance(const Point3dC &) const
Point3dC::EDistanceFromOrigin(void) const
Point3dC::CosAngle(const Point3dC &,const Point3dC &) const
Point3dC::Angle(const Point3dC &,const Point3dC &) const
Point3dC::AngleOrigin(const Point3dC &) const
Point3dC::MidPoint(const Point3dC &) const
Point3dC::Center(const Point3dC &) const
Point3dC::N(void) const
Point3dC::AbsDistance(const Point3dC &) const
Point3dC::MahalanobisDistance(const Point3dC &,const Matrix3d3C &)
Point3dC::Sum(void) const
Point3dC::SumAbs(void) const
Point3dC::Sqrt(void)
Point3dC::Abs(void)
Point3dC::Normalize(void)
Point3dC::NormalizeSum(void)
Point3dC::MakeUnit(const IndexT)
Point3dC::OrthoProjectionInto(const Line3dPVC &) const
Point3dC::OrthoProjectionTo(const PlanePVV3dC &) const
Point3dC::IsOutside(const PlaneABCD3dC &) const
Point3dC::IsInside(const PlaneABCD3dC &) const
Point3dC::FixAlmostZero(void)
Point3dC::SetZeroDistance(RealT)
Point3dC::IsAlmostZero(RealT)
Point3dC::SetRelZero(RealT)
Point3dC::IsRelZero(RealT)
|
Comments:
The class Vector3ddC represents a vector in 3 dimensional
Euclidian space. A vector is represented by point.
Parent Classes:
Derived Classes:
Methods:
- Vector3dC()
-
Creates the zero vector (0,0,0).
- Vector3dC(CoordT xCoor,CoordT yCoor,CoordT zCoor)
-
Creates the vector with coordinates (xCoor, yCoor, zCoor).
- Vector3dC(const Point3dC & point)
-
Creates the vector with coordinates (point.X(), point.Y(), point.Z()).
- Vector3dC(const Vector3dC & vector)
-
Copy constructor.
- Vector3dC(const Point3dC & start,const Point3dC & end)
-
Creates the vector (end - start).
- Vector3dC(const AngleT phi,const AngleT theta)
-
Creates the unit vector determined by the sphere coordinates.
The angle 'phi' is the azimuth measured from the x axis.
The angle 'theta' is the elevation measured from the z axis.
- Vector3dC(istream & inS)
-
Creates the vector from the input stream.
- Vector3dC(const VectorC & vector)
-
Creates the vector from the first three coordinates of the general
vector.
Access to the object.
---------------------
- const Vector3dC & Vector() const
-
Access to the vector.
- Vector3dC & Vector()
-
Access to the vector.
Setting of coordinates.
-----------------------
- Vector3dC & SetZero()
-
Sets all coordinates to be zero.
Arithmetical operations.
------------------------
- Vector3dC operator-() const
-
Returns the opposite vector.
- Vector3dC operator+(const Vector3dC & v) const
-
Returns a sum of two vectors.
- Vector3dC operator-(const Vector3dC & v) const
-
Returns a difference of two vectors.
- Vector3dC operator*(const RealT alpha) const
-
Returns this vector multiplied by the scalar 'alpha'.
- Vector3dC operator*(const Vector3dC & v) const
-
Returns the vector which coordinates are the results of multiplication
item by item of this vector and the vector 'v'.
- Vector3dC operator/(const RealT alpha) const
-
Returns this vector multiplied by the scalar 1/'alpha'.
- Point3dC operator/(const Point3dC & v) const
-
Returns the points which coordinates are results of division
of this vector and 'v' point item by item.
- const Vector3dC & operator+=(const Vector3dC & v)
-
Adds the vector 'v' to this vector. The return object is
this vector.
- const Vector3dC & operator-=(const Vector3dC & v)
-
Subtracts the vector 'v' from this vector. The return object is
this vector.
- const Vector3dC & operator*=(const RealT alpha)
-
Multiplies this vector by the scalar value 'alpha'.
The return object is this vector.
- const Vector3dC & operator/=(const RealT alpha)
-
Multiplies this vector by the scalar value 1/'alpha'.
The return object is this vector.
Geometrical operations.
-----------------------
- RealT operator&(const Vector3dC & v) const
-
Returns the scalar product of this vector and the vector 'v'.
The operator is equivalent to the member function Dot().
- Vector3dC operator%(const Vector3dC & v) const
-
Returns the cross product of this vector and the vector 'v'.
The operator is equivalent to the member function Cross().
- RealT Dot(const Vector3dC & vector) const
-
Returns the scalar product of this vector and the 'vector'.
The function is equivalent to the operator&.
- Vector3dC Cross(const Vector3dC & vector) const
-
Returns the cross product of this vector and the 'vector'.
The function is equivalent to the operator%.
- RealT Cross3(const Vector3dC & vector) const
-
Returns the 3-rd coordinate of the cross product of this vector
and the 'vector'.
- RealT TripleScalar(const Vector3dC & vectorB,const Vector3dC & vectorC) const
-
Returns the triple scalar product [*this vectorB vectorC].
- RealT Norm() const
-
Returns the Euclidian norm of this vector.
- RealT SqrNorm() const
-
Returns the square of the Euclidian norm of this vector.
- RealT Modulus() const
-
Returns the size of the vector.
- Vector3dC Unit() const
-
Returns the unit vector which direction is determined by the direction
of this vector.
- Vector3dC & MakeUnit()
-
Divides all coordinates by the size of the vector.
- Vector3dC & MakeUnit(IndexT i)
-
Divides all coordinates by the size of the i-th coordinate.
- RealT ProjectionSizeInto(const Vector3dC & v) const
-
Returns the size of the projection of this vector into the vector 'v'.
- Vector3dC ProjectionInto(const Vector3dC & v) const
-
Returns the projection of this vector into the vector 'v'.
- RealT Angle(const Vector3dC & v) const
-
Returns the angle (rad) between this vector and the vector 'v'
in the range 0-pi (ie. the smallest angle between vectors).
Rotations.
----------
The following member functions for rotation of vectors
assume a right-handed 3D coordinate system xyz. The vector
is rotated according to the static coordinate system in the
direction following the direction of
the fingers of the right hand which thumb points in the direction
of the vector of the rotation axis. That means the angle has
counter-clockwise orientation if it is seen from the positive half
of the rotation axis.
- Vector3dC RotationX(const RealT a) const
-
Returns this vector rotated through an angle 'a' (rad)
along the x axis.
- Vector3dC RotationY(const RealT a) const
-
Returns this vector rotated through an angle 'a' (rad)
along the y axis.
- Vector3dC RotationZ(const RealT a) const
-
Returns this vector rotated through an angle 'a' (rad)
along the z axis.
- Vector3dC Rotation(const Vector3dC & v,const RealT a) const
-
Returns this vector rotated through an angle 'a' (rad)
along the axis defined by the vector 'v' and passing through the
starting point of this vector.
Operations using matrices.
--------------------------
- Matrix3d3C ProductT() const
-
Returns the matrix that is the result of v * v.T().
- Vector3dC operator*(RealT alpha,const Vector3dC & v)
-
- ostream & operator<<(ostream & outS,const Vector3dC & vector)
-
- istream & operator>>(istream & inS,Vector3dC & vector)
-
- explicit Point3dC(SizeT dim)
-
Creates the point (0.0, 0.0, 0.0).
For compability with N-D points.
- const Point3dC & operator=(const Point3dC & p)
-
Assigment.
Access to the object
--------------------
- const CoordT & operator[](IndexT i) const
-
Access to the i-th constant coordinate.
- CoordT & operator[](IndexT i)
-
Access to the i-th coordinate.
- CoordT & X()
-
Access to the first coordinate.
- CoordT & Y()
-
Access to the second coordinate.
- CoordT & Z()
-
Access to the third coordinate.
- const CoordT & X() const
-
Access to the first constant coordinate.
- const CoordT & Y() const
-
Access to the second constant coordinate.
- const CoordT & Z() const
-
Access to the third constant coordinate.
- const Point3dC & Point() const
-
Access to the constant point.
- Point3dC & Point()
-
Access to the point.
Logical operators with points
-----------------------------
- BooleanT operator==(const Point3dC & point) const
-
Returns TRUE if 2 points are the same point. Two points
are claimed to be same iff their relative distance error
is small (under 'relZero' threshold). If both points
are close to the origin of the coordinate system, their
absolute distance error is compared to 'zeroDistance'.
- BooleanT operator!=(const Point3dC & point) const
-
Returns TRUE if 2 points are different. 2 points are different
iff they are not equal in the sense of the operator '=='.
- BooleanT operator>(const Point3dC & point) const
-
Returns TRUE if all coordinates are bigger then the coordinates
of the point.
- BooleanT OneBigger(const Point3dC & point) const
-
Returns TRUE if one coordinate is bigger then the related one
of the point.
Setting of the point
--------------------
- Point3dC & SetZero()
-
Sets all coordinates to be 0.0.
- void Set(const Point3dC & point)
-
Sets coordinates according to the values of 'point'.
- void Set(const CoordT xCoor,const CoordT yCoor,const CoordT zCoor)
-
Sets the point to the new coordinates.
- Point3dC & SetMinimum(const Point3dC & point)
-
Sets the point coordinates to minimal value from both points.
- Point3dC & SetMaximum(const Point3dC & point)
-
Sets the point coordinates to maximal value from both points.
Information about extrems
-------------------------
- IndexT MinIndex() const
-
Returns the index of the minimum value.
- IndexT MaxIndex() const
-
Returns the index of the maximum value.
- IndexT AbsMinIndex() const
-
Returns the index of the minimum coordinate in absolute value.
- IndexT AbsMaxIndex() const
-
Returns the index of the maximum coordinate in absolute value.
- CoordT Min() const
-
Returns the minimum coordinate.
- CoordT Max() const
-
Returns the maximum coordinate.
Arithmetical operations
-----------------------
- const Point3dC & operator+=(const Point3dC & point)
-
Adds the point.
- const Point3dC & operator-=(const Point3dC & point)
-
Subtracts the point.
- const Point3dC & operator*=(const Point3dC & point)
-
Multiplies items by point items.
- const Point3dC & operator/=(const Point3dC & point)
-
Divides items by point items.
- const Point3dC & operator*=(const RealT alpha)
-
Multiplies items by 'alpha'.
- const Point3dC & operator/=(const RealT alpha)
-
Divides items by 'alpha'.
- Point3dC operator+(const Point3dC & v) const
-
Adds 2 points.
- Vector3dC operator-(const Point3dC & v) const
-
Returns the difference between 2 points.
- Point3dC operator*(const Point3dC & v) const
-
Returns the points which coordinates are results of multiplication
of this point and 'v' points item by item.
- Point3dC operator/(const Point3dC & v) const
-
Returns the points which coordinates are results of division
of this point and 'v' points item by item.
- Point3dC operator*(const RealT alpha) const
-
Returns the points which coordinates are these coordinates
multiplied by 'alpha'.
- Point3dC operator/(const RealT alpha) const
-
Returns the points which coordinates are these coordinates
divided by 'alpha'.
- Point3dC operator+(const Vector3dC & v) const
-
Returns the point = 'this point' + v;
- RealT operator&(const Point3dC & p) const
-
Returns the sum X()*p.X() + Y()*p.Y() + Z()*p.Z().
In 3 dimensional Euclidian vector space the result is
equivalent to dot product of 2 vectors.
Euclidian geometry
------------------
- Point3dC Translation(const Point3dC & newOrigin) const
-
Returns the point with coordinates related to the new origin
'newOrigin'.
- RealT SqrEuclidDistance(const Point3dC & point) const
-
Returns the square of Euclid distance between this point
and 'point'.
- RealT EuclidDistance(const Point3dC & point) const
-
Returns the Euclid distance between this point and point.
- RealT EDistanceFromOrigin() const
-
Returns the Euclid distance of this point from the coordinate origin.
- CosAngleT CosAngle(const Point3dC & m,const Point3dC & b) const
-
Returns the cosinus of the angle (this point, m, b).
- AngleT Angle(const Point3dC & m,const Point3dC & b) const
-
Returns the angle (this point, m, b).
- AngleT AngleOrigin(const Point3dC & p) const
-
Returns the angle in rad between points 'this point', (0,0,0), and
the point 'p'.
- Point3dC MidPoint(const Point3dC & p) const
-
Returns the point which is in the middle of this point
and the point 'p'.
- Point3dC Center(const Point3dC & point) const
-
Returns the point which is in the middle of both points.
Useful functions with points
----------------------------
- SizeT N() const
-
Returns the number of coordinates of this point.
- RealT AbsDistance(const Point3dC & point) const
-
Returns the block distance between this point and 'point'.
- RealT MahalanobisDistance(const Point3dC & mean,const Matrix3d3C & invCov)
-
Returns the Mahalanobis distance from the 'mean'. The 'invCov'
is the inversion of the covariance matrix.
- CoordT Sum() const
-
Returns the sum of coordinates.
- CoordT SumAbs() const
-
Returns the sum of absolute value of coordinates.
- Point3dC & Sqrt()
-
Changes all coordinates into their square root values.
- Point3dC & Abs()
-
Changes all coordinates into their absolute values.
- Point3dC & Normalize()
-
Scales the coordinates of the point to have the distance
from the origin equal to 1. The point is supposed to be different
from the origin.
- Point3dC & NormalizeSum()
-
Scales the coordinates of the point to have unit sum.
The point is supposed to be different from the origin.
- Point3dC & MakeUnit(const IndexT i)
-
Scales the coordinates of the point that the i-th coordinate
will be equal to 1. The range of the index i is not checked.
Relationship with a line
------------------------
- Point3dC OrthoProjectionInto(const Line3dPVC & l) const
-
Returns the orthogonal projection of the point into the line 'l'.
Relationship with a plane
-------------------------
- Point3dC OrthoProjectionTo(const PlanePVV3dC & plane) const
-
Orthogonal projection of the point into the plane
- BooleanT IsOutside(const PlaneABCD3dC & plane) const
-
Returns TRUE if the point is on the side of the plane
where the normal of the plane points to.
- BooleanT IsInside(const PlaneABCD3dC & plane) const
-
Returns TRUE if the point is on the side of the plane
where the normal of the plane does not point to.
Computational precision
-----------------------
- void FixAlmostZero()
-
If the absolute value of a coordinate is smaller than zoroDistance
the function sets the coordinate to be zero.
- RealT SetZeroDistance(RealT zero)
-
Sets the precision of test of zero distance of points.
The function returns the previous value.
- BooleanT IsAlmostZero(RealT a)
-
Returns TRUE if 'a' is smaller or equal to zeroDistance.
- RealT SetRelZero(RealT zero)
-
Sets the precision of the relative error test.
The function returns the previous value.
- BooleanT IsRelZero(RealT a)
-
Returns TRUE if 'a' is smaller than or equal to 'relZero'.
|
Programmer:Radek Marik, Documentation by CxxDoc: Tue Mar 20 10:48:08 2001
|