Clipper
Public Member Functions | Static Public Member Functions | Friends
clipper::Vec3< T > Class Template Reference

3-vector class More...

#include <clipper_types.h>

Inheritance diagram for clipper::Vec3< T >:
clipper::Grad_frac< T > clipper::Grad_map< T > clipper::Grad_orth< T >

List of all members.

Public Member Functions

 Vec3 ()
 null constructor
 Vec3 (const T &v0, const T &v1, const T &v2)
 constructor: from individual values
template<class TT >
 Vec3 (const Vec3< TT > &v)
 constructor: copy/convert
bool equals (const Vec3< T > &v, const T &tol) const
 test equality
const T & operator[] (const int &i) const
 get element
T & operator[] (const int &i)
 set element
Vec3< T > unit () const
 return unit vector with same direction as this vector
bool is_null () const
 test for null vector
String format () const
 return formatted String representation
const Vec3< T > & operator+= (const Vec3< T > &v)
 add another vector to this one
const Vec3< T > & operator-= (const Vec3< T > &v)
 subtract another vector from this one

Static Public Member Functions

static Vec3< T > zero ()
 return zero vector
static Vec3< T > null ()
 return null vector (only valid for floating point types)
static T dot (const Vec3< T > &v1, const Vec3< T > &v2)
 Vector dot product (equivalent to *)
static Vec3< T > cross (const Vec3< T > &v1, const Vec3< T > &v2)
 Vector cross product.

Friends

int operator== (const Vec3< T > &v1, const Vec3< T > &v2)
 Vector equality (for floating point types see equals())
int operator!= (const Vec3< T > &v1, const Vec3< T > &v2)
 Vector inequality (for floating point types see equals())
Vec3< T > operator- (const Vec3< T > &v)
 Vector negation operator.
Vec3< T > operator+ (const Vec3< T > &v1, const Vec3< T > &v2)
 Vector addition operator.
Vec3< T > operator- (const Vec3< T > &v1, const Vec3< T > &v2)
 Vector subtraction operator.
Vec3< T > operator* (const T &s, const Vec3< T > &v1)
 Vector scaling operator.
Vec3< T > operator* (const Vec3< T > &v1, const T &s)
 Vector scaling operator.
operator* (const Vec3< T > &v1, const Vec3< T > &v2)
 Vector dot product.

Detailed Description

template<class T = ftype>
class clipper::Vec3< T >

3-vector class


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