Templates -- Meow  204.13.18
A C++ template contains kinds of interesting classes and functions
meow::Vector3D< Scalar > Class Template Reference

3D's vector More...

#include "Vectors.h"

Public Member Functions

 Vector3D ()
 consturctor (0, 0) More...
 
 Vector3D (Vector3D const &v)
 consturctor (from another Vector3D) More...
 
 Vector3D (Scalar const &s)
 constructor (s, s) More...
 
 Vector3D (Scalar const &sx, Scalar const &sy, Scalar const &sz)
 constructor (sx, sy) More...
 
 Vector3D (Vector< Scalar > const &v)
 constructor (from another Vector) More...
 
 Vector3D (Vector< Scalar > const &v, size_t i)
 constructor (from another Vector, i-th) More...
 
 ~Vector3D ()
 destructor More...
 
Vector3DcopyFrom (Vector3D const &v)
 copy More...
 
Scalar const & x () const
 access x More...
 
Scalar const & y () const
 access y More...
 
Scalar const & z () const
 access z More...
 
Scalar & xGet ()
 access x with non constant reference More...
 
Scalar & yGet ()
 access y with non constant reference More...
 
Scalar & zGet ()
 access z with non constant reference More...
 
Scalar const & x (Scalar const &s)
 modify x More...
 
Scalar const & y (Scalar const &s)
 modify y More...
 
Scalar const & z (Scalar const &s)
 modify z More...
 
Vector3Dxyz (Scalar const &sx, Scalar const &sy, Scalar const &sz)
 modify x and y More...
 
Scalar const & scalar (size_t i) const
 access the i -th scalar (0 => x, 1 => y, 2 => z) { More...
 
Scalar const & scalar (size_t i, Scalar const &s)
 modivy the i -th scalar (0 => x, 1 => y, 2 => z) More...
 
Vector3D positive () const
 return +(*this) More...
 
Vector3D negative () const
 return -(*this) More...
 
Vector3D add (Vector3D const &v) const
 return (*this)+v More...
 
Vector3Dadded (Vector3D const &v)
 Let itself add v. More...
 
Vector3D sub (Vector3D const &v) const
 return (*this)-v More...
 
Vector3Dsubed (Vector3D const &v)
 Let itself substract v. More...
 
Vector3D mul (Scalar const &s) const
 return (*this)*s , where s is a scalar More...
 
Vector3Dmuled (Scalar const &s)
 Let itself mulitple s. More...
 
Vector3D div (Scalar const &s) const
 return (*this)/s , where s is a scalar More...
 
Vector3Ddived (Scalar const &s)
 Let itself divide s. More...
 
Scalar mul (Vector3D const &v) const
 same as dot(v) More...
 
Scalar dot (Vector3D const &v) const
 dot More...
 
Vector3D cross (Vector3D const &v) const
 cross More...
 
Vector3Dcrossed (Vector3D const &v)
 crossed More...
 
Scalar length () const
 sqrt of length2 More...
 
Scalar length2 () const
 same as dot(*this) More...
 
Vector3D normalize () const
 return normalize form of itself More...
 
Vector3Dnormalized ()
 normalize itself More...
 
Vector3D rotate (Vector3D const &axis, double theta) const
 return rotate theta degree by axis of itself More...
 
Vector3Drotated (Vector3D const &axis, double theta)
 Let itself rotate theta degree. More...
 
Vector3D reflect (Vector3D const &v) const
 return reflect from given vector v More...
 
Vector3Dreflected (Vector3D const &v)
 reflect itself given vector v More...
 
Matrix< Scalar > matrix () const
 return a 3x1 matrix form of itself More...
 
Matrix< Scalar > matrix (Scalar const &homo) const
 return a 4x1 matrix form of itself More...
 
Scalar const & operator() (size_t n) const
 
Vector3Doperator() (Scalar const &sx, Scalar const &sy, Scalar const &sz)
 
Vector3D operator+ () const
 
Vector3D operator- () const
 
Vector3D operator+ (Vector3D const &v) const
 
Vector3D operator- (Vector3D const &v) const
 
Vector3D operator* (Scalar const &s) const
 
Vector3D operator/ (Scalar const &s) const
 
Scalar operator* (Vector3D const &v) const
 
Vector3Doperator= (Vector3D const &v)
 
Vector3Doperator+= (Vector3D const &v)
 
Vector3Doperator-= (Vector3D const &v)
 
Vector3Doperator*= (Scalar const &s)
 
Vector3Doperator/= (Scalar const &s)
 

Detailed Description

template<class Scalar>
class meow::Vector3D< Scalar >

3D's vector

Author
cat_leopard

Definition at line 265 of file Vectors.h.

Constructor & Destructor Documentation

template<class Scalar>
meow::Vector3D< Scalar >::Vector3D ( )
inline

consturctor (0, 0)

Definition at line 270 of file Vectors.h.

template<class Scalar>
meow::Vector3D< Scalar >::Vector3D ( Vector3D< Scalar > const &  v)
inline

consturctor (from another Vector3D)

Definition at line 274 of file Vectors.h.

template<class Scalar>
meow::Vector3D< Scalar >::Vector3D ( Scalar const &  s)
inline

constructor (s, s)

Definition at line 278 of file Vectors.h.

template<class Scalar>
meow::Vector3D< Scalar >::Vector3D ( Scalar const &  sx,
Scalar const &  sy,
Scalar const &  sz 
)
inline

constructor (sx, sy)

Definition at line 282 of file Vectors.h.

template<class Scalar>
meow::Vector3D< Scalar >::Vector3D ( Vector< Scalar > const &  v)
inline

constructor (from another Vector)

Definition at line 288 of file Vectors.h.

template<class Scalar>
meow::Vector3D< Scalar >::Vector3D ( Vector< Scalar > const &  v,
size_t  i 
)
inline

constructor (from another Vector, i-th)

Definition at line 292 of file Vectors.h.

template<class Scalar>
meow::Vector3D< Scalar >::~Vector3D ( )
inline

destructor

Definition at line 296 of file Vectors.h.

Member Function Documentation

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::add ( Vector3D< Scalar > const &  v) const
inline

return (*this)+v

Definition at line 381 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::added ( Vector3D< Scalar > const &  v)
inline

Let itself add v.

Definition at line 386 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::copyFrom ( Vector3D< Scalar > const &  v)
inline

copy

Definition at line 300 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::cross ( Vector3D< Scalar > const &  v) const
inline

cross

Definition at line 431 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::crossed ( Vector3D< Scalar > const &  v)
inline

crossed

Definition at line 438 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::div ( Scalar const &  s) const
inline

return (*this)/s , where s is a scalar

Definition at line 411 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::dived ( Scalar const &  s)
inline

Let itself divide s.

Definition at line 416 of file Vectors.h.

template<class Scalar>
Scalar meow::Vector3D< Scalar >::dot ( Vector3D< Scalar > const &  v) const
inline

dot

Definition at line 426 of file Vectors.h.

template<class Scalar>
Scalar meow::Vector3D< Scalar >::length ( ) const
inline

sqrt of length2

Definition at line 443 of file Vectors.h.

template<class Scalar>
Scalar meow::Vector3D< Scalar >::length2 ( ) const
inline

same as dot(*this)

Definition at line 448 of file Vectors.h.

template<class Scalar>
Matrix<Scalar> meow::Vector3D< Scalar >::matrix ( ) const
inline

return a 3x1 matrix form of itself

Definition at line 486 of file Vectors.h.

template<class Scalar>
Matrix<Scalar> meow::Vector3D< Scalar >::matrix ( Scalar const &  homo) const
inline

return a 4x1 matrix form of itself

Definition at line 495 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::mul ( Scalar const &  s) const
inline

return (*this)*s , where s is a scalar

Definition at line 401 of file Vectors.h.

template<class Scalar>
Scalar meow::Vector3D< Scalar >::mul ( Vector3D< Scalar > const &  v) const
inline

same as dot(v)

Definition at line 421 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::muled ( Scalar const &  s)
inline

Let itself mulitple s.

Definition at line 406 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::negative ( ) const
inline

return -(*this)

Definition at line 376 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::normalize ( ) const
inline

return normalize form of itself

Definition at line 453 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::normalized ( )
inline

normalize itself

Definition at line 458 of file Vectors.h.

template<class Scalar>
Scalar const& meow::Vector3D< Scalar >::operator() ( size_t  n) const
inline

Definition at line 504 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::operator() ( Scalar const &  sx,
Scalar const &  sy,
Scalar const &  sz 
)
inline

Definition at line 508 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::operator* ( Scalar const &  s) const
inline

Definition at line 517 of file Vectors.h.

template<class Scalar>
Scalar meow::Vector3D< Scalar >::operator* ( Vector3D< Scalar > const &  v) const
inline

Definition at line 519 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::operator*= ( Scalar const &  s)
inline

Definition at line 524 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::operator+ ( ) const
inline

Definition at line 512 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::operator+ ( Vector3D< Scalar > const &  v) const
inline

Definition at line 515 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::operator+= ( Vector3D< Scalar > const &  v)
inline

Definition at line 522 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::operator- ( ) const
inline

Definition at line 513 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::operator- ( Vector3D< Scalar > const &  v) const
inline

Definition at line 516 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::operator-= ( Vector3D< Scalar > const &  v)
inline

Definition at line 523 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::operator/ ( Scalar const &  s) const
inline

Definition at line 518 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::operator/= ( Scalar const &  s)
inline

Definition at line 525 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::operator= ( Vector3D< Scalar > const &  v)
inline

Definition at line 521 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::positive ( ) const
inline

return +(*this)

Definition at line 371 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::reflect ( Vector3D< Scalar > const &  v) const
inline

return reflect from given vector v

Definition at line 476 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::reflected ( Vector3D< Scalar > const &  v)
inline

reflect itself given vector v

Definition at line 481 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::rotate ( Vector3D< Scalar > const &  axis,
double  theta 
) const
inline

return rotate theta degree by axis of itself

Definition at line 463 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::rotated ( Vector3D< Scalar > const &  axis,
double  theta 
)
inline

Let itself rotate theta degree.

Definition at line 471 of file Vectors.h.

template<class Scalar>
Scalar const& meow::Vector3D< Scalar >::scalar ( size_t  i) const
inline

access the i -th scalar (0 => x, 1 => y, 2 => z) {

Definition at line 361 of file Vectors.h.

template<class Scalar>
Scalar const& meow::Vector3D< Scalar >::scalar ( size_t  i,
Scalar const &  s 
)
inline

modivy the i -th scalar (0 => x, 1 => y, 2 => z)

Definition at line 366 of file Vectors.h.

template<class Scalar>
Vector3D meow::Vector3D< Scalar >::sub ( Vector3D< Scalar > const &  v) const
inline

return (*this)-v

Definition at line 391 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::subed ( Vector3D< Scalar > const &  v)
inline

Let itself substract v.

Definition at line 396 of file Vectors.h.

template<class Scalar>
Scalar const& meow::Vector3D< Scalar >::x ( ) const
inline

access x

Definition at line 305 of file Vectors.h.

template<class Scalar>
Scalar const& meow::Vector3D< Scalar >::x ( Scalar const &  s)
inline

modify x

Definition at line 335 of file Vectors.h.

template<class Scalar>
Scalar& meow::Vector3D< Scalar >::xGet ( )
inline

access x with non constant reference

Definition at line 320 of file Vectors.h.

template<class Scalar>
Vector3D& meow::Vector3D< Scalar >::xyz ( Scalar const &  sx,
Scalar const &  sy,
Scalar const &  sz 
)
inline

modify x and y

Definition at line 353 of file Vectors.h.

template<class Scalar>
Scalar const& meow::Vector3D< Scalar >::y ( ) const
inline

access y

Definition at line 310 of file Vectors.h.

template<class Scalar>
Scalar const& meow::Vector3D< Scalar >::y ( Scalar const &  s)
inline

modify y

Definition at line 341 of file Vectors.h.

template<class Scalar>
Scalar& meow::Vector3D< Scalar >::yGet ( )
inline

access y with non constant reference

Definition at line 325 of file Vectors.h.

template<class Scalar>
Scalar const& meow::Vector3D< Scalar >::z ( ) const
inline

access z

Definition at line 315 of file Vectors.h.

template<class Scalar>
Scalar const& meow::Vector3D< Scalar >::z ( Scalar const &  s)
inline

modify z

Definition at line 347 of file Vectors.h.

template<class Scalar>
Scalar& meow::Vector3D< Scalar >::zGet ( )
inline

access z with non constant reference

Definition at line 330 of file Vectors.h.


The documentation for this class was generated from the following file: