Templates -- Meow  1.2.9
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...
 
size_t dimension () const
 return 2 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, y and z 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 245 of file Vectors.h.

Constructor & Destructor Documentation

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

consturctor (0, 0)

Definition at line 250 of file Vectors.h.

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

consturctor (from another Vector3D)

Definition at line 254 of file Vectors.h.

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

constructor (s, s)

Definition at line 258 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 262 of file Vectors.h.

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

constructor (from another Vector)

Definition at line 268 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 272 of file Vectors.h.

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

destructor

Definition at line 276 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 328 of file Vectors.h.

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

Let itself add v.

Definition at line 333 of file Vectors.h.

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

copy

Definition at line 280 of file Vectors.h.

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

cross

Definition at line 378 of file Vectors.h.

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

crossed

Definition at line 385 of file Vectors.h.

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

return 2

Definition at line 284 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 358 of file Vectors.h.

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

Let itself divide s.

Definition at line 363 of file Vectors.h.

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

dot

Definition at line 373 of file Vectors.h.

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

sqrt of length2

Definition at line 390 of file Vectors.h.

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

same as dot(*this)

Definition at line 395 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 433 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 442 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 348 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 368 of file Vectors.h.

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

Let itself mulitple s.

Definition at line 353 of file Vectors.h.

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

return -(*this)

Definition at line 323 of file Vectors.h.

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

return normalize form of itself

Definition at line 400 of file Vectors.h.

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

normalize itself

Definition at line 405 of file Vectors.h.

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

Definition at line 451 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 455 of file Vectors.h.

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

Definition at line 464 of file Vectors.h.

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

Definition at line 466 of file Vectors.h.

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

Definition at line 471 of file Vectors.h.

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

Definition at line 459 of file Vectors.h.

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

Definition at line 462 of file Vectors.h.

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

Definition at line 469 of file Vectors.h.

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

Definition at line 460 of file Vectors.h.

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

Definition at line 463 of file Vectors.h.

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

Definition at line 470 of file Vectors.h.

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

Definition at line 465 of file Vectors.h.

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

Definition at line 472 of file Vectors.h.

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

Definition at line 468 of file Vectors.h.

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

return +(*this)

Definition at line 318 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 423 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 428 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 410 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 418 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 307 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 313 of file Vectors.h.

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

return (*this)-v

Definition at line 338 of file Vectors.h.

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

Let itself substract v.

Definition at line 343 of file Vectors.h.

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

access x

Definition at line 286 of file Vectors.h.

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

modify x

Definition at line 294 of file Vectors.h.

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

access x with non-constant reference

Definition at line 290 of file Vectors.h.

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

modify x, y and z

Definition at line 299 of file Vectors.h.

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

access y

Definition at line 287 of file Vectors.h.

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

modify y

Definition at line 295 of file Vectors.h.

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

access y with non-constant reference

Definition at line 291 of file Vectors.h.

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

access z

Definition at line 288 of file Vectors.h.

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

modify z

Definition at line 296 of file Vectors.h.

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

access z with non-constant reference

Definition at line 292 of file Vectors.h.


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