SeVec3d Class Reference

A 3d point/vector class. More...

#include <SeVec3d.h>

List of all members.

Public Types

typedef double array [3]
 for compatibility with double array[3]

Public Member Functions

 SeVec3d ()
 SeVec3d (double v)
 SeVec3d (double x, double y, double z)
 SeVec3d (const double *v)
 SeVec3d (const float *v)
 operator array & ()
double & operator[] (int i)
 Accesses indexed component of vector.
double operator[] (int i) const
 Accesses indexed component of vector (const).
SeVec3doperator= (const SeVec3d &v)
SeVec3doperator*= (double d)
SeVec3doperator/= (double d)
SeVec3doperator+= (const SeVec3d &v)
SeVec3doperator-= (const SeVec3d &v)
SeVec3d operator- () const
bool operator== (const SeVec3d &v) const
bool operator!= (const SeVec3d &v) const
SeVec3d operator* (double d) const
SeVec3d operator/ (double d) const
SeVec3d operator* (const SeVec3d &v) const
SeVec3d operator/ (const SeVec3d &v) const
SeVec3d operator+ (const SeVec3d &v) const
SeVec3d operator- (const SeVec3d &v) const
void getValue (double &x, double &y, double &z) const
const double * getValue () const
void setValue (double x, double y, double z)
void setValue (const double *v)
double dot (const SeVec3d &v) const
SeVec3d cross (const SeVec3d &v) const
void negate ()
double length () const
SeVec3d normalized () const
void normalize ()
SeVec3d orthogonal () const
double angle (const SeVec3d &v) const
SeVec3d rotateBy (const SeVec3d &axis, double angle_) const

Private Attributes

double _vec [3]

Friends

SeVec3d operator* (double d, const SeVec3d &v)
std::ostream & operator<< (std::ostream &os, const SeVec3d &v)

Detailed Description

A 3d point/vector class.

This class represents 3d points and vectors of doubles. In reality, this is a vector with the base point at the global origin. Why? Because you cant really add points, subtract points, and so forth -- at least mathematically.

Definition at line 27 of file SeVec3d.h.


Member Typedef Documentation

typedef double SeVec3d::array[3]

for compatibility with double array[3]

Definition at line 51 of file SeVec3d.h.


Constructor & Destructor Documentation

SeVec3d::SeVec3d (  )  [inline]

Default constructor.

Definition at line 32 of file SeVec3d.h.

Referenced by cross(), operator*(), operator+(), operator-(), operator/(), and orthogonal().

SeVec3d::SeVec3d ( double  v  )  [inline]

Scalar constructor.

Definition at line 35 of file SeVec3d.h.

References setValue().

SeVec3d::SeVec3d ( double  x,
double  y,
double  z 
) [inline]

Component constructor.

Definition at line 39 of file SeVec3d.h.

References setValue().

SeVec3d::SeVec3d ( const double *  v  )  [inline]

Array constructor.

Definition at line 43 of file SeVec3d.h.

References setValue().

SeVec3d::SeVec3d ( const float *  v  )  [inline]

Array constructor.

Definition at line 47 of file SeVec3d.h.

References setValue().


Member Function Documentation

double SeVec3d::angle ( const SeVec3d v  )  const [inline]

Returns the angle in radians between the current vector and the passed in vector.

Definition at line 182 of file SeVec3d.h.

References dot(), and length().

SeVec3d SeVec3d::cross ( const SeVec3d v  )  const [inline]

Cross product.

Definition at line 145 of file SeVec3d.h.

References _vec, and SeVec3d().

Referenced by rotateBy().

double SeVec3d::dot ( const SeVec3d v  )  const [inline]

Inner product.

Definition at line 141 of file SeVec3d.h.

References _vec.

Referenced by angle(), rotateBy(), SeExpr::saturate(), SeExpr::voronoi_f1_3d(), and SeExpr::voronoi_f1f2_3d().

const double* SeVec3d::getValue (  )  const [inline]

Get coordinates as array.

Definition at line 129 of file SeVec3d.h.

References _vec.

void SeVec3d::getValue ( double &  x,
double &  y,
double &  z 
) const [inline]

Get coordinates.

Definition at line 125 of file SeVec3d.h.

References _vec.

double SeVec3d::length (  )  const [inline]

Length of vector.

Definition at line 155 of file SeVec3d.h.

References _vec.

Referenced by angle(), normalize(), normalized(), and SeExpr::rotate().

void SeVec3d::negate (  )  [inline]

Negate vector.

Definition at line 151 of file SeVec3d.h.

References _vec.

void SeVec3d::normalize (  )  [inline]

Normalize vector.

Definition at line 167 of file SeVec3d.h.

References length().

SeVec3d SeVec3d::normalized (  )  const [inline]

Return normalized vector

Definition at line 159 of file SeVec3d.h.

References length().

SeVec3d::operator array & (  )  [inline]

Definition at line 52 of file SeVec3d.h.

References _vec.

bool SeVec3d::operator!= ( const SeVec3d v  )  const [inline]

Inequality comparison.

Definition at line 89 of file SeVec3d.h.

SeVec3d SeVec3d::operator* ( const SeVec3d v  )  const [inline]

Component-wise binary vector multiplication.

Definition at line 105 of file SeVec3d.h.

References _vec, and SeVec3d().

SeVec3d SeVec3d::operator* ( double  d  )  const [inline]

Component-wise binary scalar multiplication.

Definition at line 93 of file SeVec3d.h.

References _vec, and SeVec3d().

SeVec3d& SeVec3d::operator*= ( double  d  )  [inline]

Component-wise scalar multiplication.

Definition at line 65 of file SeVec3d.h.

References _vec.

SeVec3d SeVec3d::operator+ ( const SeVec3d v  )  const [inline]

Component-wise binary vector addition.

Definition at line 113 of file SeVec3d.h.

References _vec, and SeVec3d().

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

Component-wise vector addition.

Definition at line 73 of file SeVec3d.h.

References _vec.

SeVec3d SeVec3d::operator- ( const SeVec3d v  )  const [inline]

Component-wise binary vector subtraction.

Definition at line 117 of file SeVec3d.h.

References _vec, and SeVec3d().

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

Nondestructive unary negation - returns a new vector.

Definition at line 81 of file SeVec3d.h.

References _vec, and SeVec3d().

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

Component-wise vector subtraction.

Definition at line 77 of file SeVec3d.h.

References _vec.

SeVec3d SeVec3d::operator/ ( const SeVec3d v  )  const [inline]

Component-wise binary vector division.

Definition at line 109 of file SeVec3d.h.

References _vec, and SeVec3d().

SeVec3d SeVec3d::operator/ ( double  d  )  const [inline]

Component-wise binary scalar division

Definition at line 97 of file SeVec3d.h.

SeVec3d& SeVec3d::operator/= ( double  d  )  [inline]

Component-wise scalar division.

Definition at line 69 of file SeVec3d.h.

SeVec3d& SeVec3d::operator= ( const SeVec3d v  )  [inline]

Assignment.

Definition at line 61 of file SeVec3d.h.

References _vec.

bool SeVec3d::operator== ( const SeVec3d v  )  const [inline]

Equality comparison.

Definition at line 85 of file SeVec3d.h.

References _vec.

double SeVec3d::operator[] ( int  i  )  const [inline]

Accesses indexed component of vector (const).

Definition at line 58 of file SeVec3d.h.

References _vec.

double& SeVec3d::operator[] ( int  i  )  [inline]

Accesses indexed component of vector.

Definition at line 55 of file SeVec3d.h.

References _vec.

SeVec3d SeVec3d::orthogonal (  )  const [inline]

Return a vector orthogonal to the current vector.

Definition at line 174 of file SeVec3d.h.

References _vec, and SeVec3d().

SeVec3d SeVec3d::rotateBy ( const SeVec3d axis,
double  angle_ 
) const [inline]

Returns the vector rotated by the angle given in radians about the given axis. (Axis must be normalized)

Definition at line 192 of file SeVec3d.h.

References cross(), dot(), and sin().

Referenced by SeExpr::rotate().

void SeVec3d::setValue ( const double *  v  )  [inline]

Set coordinates as array.

Definition at line 137 of file SeVec3d.h.

References _vec.

void SeVec3d::setValue ( double  x,
double  y,
double  z 
) [inline]

Set coordinates.

Definition at line 133 of file SeVec3d.h.

References _vec.

Referenced by SeVec3d().


Friends And Related Function Documentation

SeVec3d operator* ( double  d,
const SeVec3d v 
) [friend]

Component-wise binary scalar multiplication.

Definition at line 101 of file SeVec3d.h.

std::ostream& operator<< ( std::ostream &  os,
const SeVec3d v 
) [friend]

Output a formatted string for the vector to a stream.

Definition at line 121 of file SeVec3d.h.


Member Data Documentation

double SeVec3d::_vec[3] [private]

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

Generated on 25 Jul 2013 for SeExpr by  doxygen 1.6.1