vect3d Struct Reference

Generic vector for 3D space. More...

#include <math3d.hpp>

List of all members.

Public Member Functions

 vect3d ()
 vect3d (prec_t a, prec_t b, prec_t c)
void clear ()
void add (const vect3d &a)
void normalize ()
vect3d normal () const
 
Returns:
Normalized vector.

prec_t magnitude () const
 
Returns:
$x^2+y^2+z^2$

prec_t length () const
 
Returns:
$\sqrt{x^2+y^2+z^2}$

void operator *= (prec_t f)
void operator+= (const vect3d &v)
void operator-= (const vect3d &v)
void operator/= (prec_t f)
void operator= (prec_t f)
vect3d operator- () const
vect3d recip () const
void across (vect3d &out)
 Find a vector that is at right angle to this.
void print (const char *name=0) const
 Print vector value into stdout.
char * sprint (char *buf) const
 Print vector into buffer.

Public Attributes

prec_t x
prec_t y
prec_t z

Friends

vect3d operator * (prec_t f, const vect3d &v)
vect3d operator * (const vect3d &v, prec_t f)
vect3d operator/ (const vect3d &v, prec_t f)
vect3d operator+ (const vect3d &l, const vect3d &r)
vect3d operator- (const vect3d &l, const vect3d &r)
vect3d operator% (const vect3d &l, const vect3d &r)
 Cross product.
prec_t operator * (const vect3d &l, const vect3d &r)
 Dot product.
bool operator== (const vect3d &l, const vect3d &r)
bool operator!= (const vect3d &l, const vect3d &r)
bool operator< (const vect3d &l, const vect3d &r)


Detailed Description

Generic vector for 3D space.

Definition at line 438 of file math3d.hpp.


Constructor & Destructor Documentation

vect3d::vect3d (  )  [inline]

Definition at line 442 of file math3d.hpp.

Referenced by recip().

vect3d::vect3d ( prec_t  a,
prec_t  b,
prec_t  c 
) [inline]

Definition at line 443 of file math3d.hpp.


Member Function Documentation

void vect3d::clear (  )  [inline]

Definition at line 445 of file math3d.hpp.

References y, and z.

void vect3d::add ( const vect3d a  )  [inline]

Definition at line 446 of file math3d.hpp.

References x, y, and z.

Referenced by operator+=(), and operator-=().

void vect3d::normalize (  )  [inline]

Definition at line 447 of file math3d.hpp.

References length().

Referenced by normal().

vect3d vect3d::normal (  )  const [inline]

Returns:
Normalized vector.

Definition at line 449 of file math3d.hpp.

References normalize().

Referenced by CoilFactory::make_coilpair(), and PLink::PLink().

prec_t vect3d::magnitude (  )  const [inline]

Returns:
$x^2+y^2+z^2$

Definition at line 451 of file math3d.hpp.

Referenced by length().

prec_t vect3d::length (  )  const [inline]

Returns:
$\sqrt{x^2+y^2+z^2}$

Definition at line 453 of file math3d.hpp.

References magnitude(), and prec_t_sqrt.

Referenced by normalize().

void vect3d::operator *= ( prec_t  f  )  [inline]

Definition at line 455 of file math3d.hpp.

References y, and z.

void vect3d::operator+= ( const vect3d v  )  [inline]

Definition at line 456 of file math3d.hpp.

References add().

void vect3d::operator-= ( const vect3d v  )  [inline]

Definition at line 457 of file math3d.hpp.

References add().

void vect3d::operator/= ( prec_t  f  )  [inline]

Definition at line 458 of file math3d.hpp.

References y, and z.

void vect3d::operator= ( prec_t  f  )  [inline]

Definition at line 460 of file math3d.hpp.

References y, and z.

vect3d vect3d::operator- (  )  const [inline]

Definition at line 501 of file math3d.hpp.

vect3d vect3d::recip (  )  const [inline]

Definition at line 503 of file math3d.hpp.

References vect3d(), y, and z.

void vect3d::across ( vect3d out  ) 

Find a vector that is at right angle to this.

void vect3d::print ( const char *  name = 0  )  const

Print vector value into stdout.

char* vect3d::sprint ( char *  buf  )  const

Print vector into buffer.


Friends And Related Function Documentation

vect3d operator * ( prec_t  f,
const vect3d v 
) [friend]

Definition at line 462 of file math3d.hpp.

vect3d operator * ( const vect3d v,
prec_t  f 
) [friend]

Definition at line 465 of file math3d.hpp.

vect3d operator/ ( const vect3d v,
prec_t  f 
) [friend]

Definition at line 468 of file math3d.hpp.

vect3d operator+ ( const vect3d l,
const vect3d r 
) [friend]

Definition at line 471 of file math3d.hpp.

vect3d operator- ( const vect3d l,
const vect3d r 
) [friend]

Definition at line 474 of file math3d.hpp.

vect3d operator% ( const vect3d l,
const vect3d r 
) [friend]

Cross product.

Definition at line 478 of file math3d.hpp.

prec_t operator * ( const vect3d l,
const vect3d r 
) [friend]

Dot product.

Definition at line 482 of file math3d.hpp.

bool operator== ( const vect3d l,
const vect3d r 
) [friend]

Definition at line 485 of file math3d.hpp.

bool operator!= ( const vect3d l,
const vect3d r 
) [friend]

Definition at line 488 of file math3d.hpp.

bool operator< ( const vect3d l,
const vect3d r 
) [friend]

Definition at line 491 of file math3d.hpp.


Member Data Documentation

prec_t vect3d::x

Definition at line 440 of file math3d.hpp.

Referenced by add(), differator< N >::getDifference(), FPReader::read(), transf3d::reflect(), transf3d::transf3d(), transf3d::transform(), and FPWriter::write().

prec_t vect3d::y

Definition at line 440 of file math3d.hpp.

Referenced by add(), clear(), differator< N >::getDifference(), operator *=(), operator/=(), operator=(), FPReader::read(), recip(), transf3d::reflect(), transf3d::transf3d(), transf3d::transform(), and FPWriter::write().

prec_t vect3d::z

Definition at line 440 of file math3d.hpp.

Referenced by add(), clear(), differator< N >::getDifference(), operator *=(), operator/=(), operator=(), FPReader::read(), recip(), transf3d::reflect(), transf3d::transf3d(), transf3d::transform(), and FPWriter::write().


The documentation for this struct was generated from the following file:
Generated on Thu Dec 6 20:31:18 2007 for Ephi by  doxygen 1.5.0