Grid3
Public Member Functions | Public Attributes | Friends | List of all members
Vec3< T > Class Template Reference

Class representing 3D vectors, with elements of type T. More...

#include <Vector3.h>

Public Member Functions

 Vec3 (T _x=0, T _y=0, T _z=0)
 Standard constructor.
 
template<class T2 >
 Vec3 (Vec3< T2 > v)
 Copy constructor.
 
Vec3< T > operator+ (const Vec3< T > &v) const
 Vector addition.
 
Vec3< T > & operator+= (const Vec3< T > &v)
 In-place vector addition.
 
Vec3< T > operator- (const Vec3< T > &v) const
 Vector subtraction.
 
Vec3< T > & operator-= (const Vec3< T > &v)
 In-place vector subtraction.
 
Vec3< T > operator* (const double &d) const
 Multiplication with double.
 
Vec3< T > & operator*= (const double &d)
 In-place multiplication with double.
 
Vec3< T > operator/ (const double &d) const
 Division with double.
 
Vec3< T > & operator/= (const double &d)
 In-place division with double.
 
double operator* (const Vec3< T > &v) const
 Scalar product.
 
Vec3< T > cross (const Vec3< T > &v) const
 Cross product.
 
Vec3< T > operator% (const Vec3< T > &v) const
 Element-wise multiplication (hadamard product)
 
Vec3< T > & normalize ()
 Normalize.
 
double norm () const
 Vector norm.
 
double norm2 () const
 Vector norm squared.
 
bool operator== (const Vec3< T > &v) const
 Equal (used for integer position vectors)
 
bool operator!= (const Vec3< T > &v) const
 Not equal (used for integer position vectors)
 

Public Attributes

x
 
y
 
z
 

Friends

Vec3< T > operator* (const double &d, const Vec3< T > &v)
 Multiplication with double.
 
std::ostream & operator<< (std::ostream &os, const Vec3< T > &v)
 Write to ostream.
 

Detailed Description

template<class T>
class Vec3< T >

Class representing 3D vectors, with elements of type T.


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