DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | List of all members
CGLA::Vec3d Class Reference

A 3D double vector. More...

#include <Vec3d.h>

Inheritance diagram for CGLA::Vec3d:
CGLA::ArithVec3Float< double, Vec3d > CGLA::ArithVecFloat< double, Vec3d, 3 > CGLA::ArithVec< double, Vec3d, N >

Public Member Functions

 Vec3d () noexcept
 Construct 0 vector.
 
 Vec3d (double a, double b, double c) noexcept
 Construct vector.
 
 Vec3d (double a) noexcept
 Construct vector where all coords = a.
 
 Vec3d (const Vec3i &v) noexcept
 Convert from int vector.
 
 Vec3d (const Vec3usi &v) noexcept
 Construct from a 3D unsigned int vector.
 
 Vec3d (const Vec3f &v) noexcept
 Convert from float vector.
 
- Public Member Functions inherited from CGLA::ArithVec3Float< double, Vec3d >
 ArithVec3Float (doublea, doubleb, doublec) noexcept
 Construct a 3D float vector.
 
 ArithVec3Float () noexcept
 Construct a 3D float vector.
 
void get_spherical (double &, double &, double &) const
 
void set_spherical (double, double, double)
 
- Public Member Functions inherited from CGLA::ArithVecFloat< double, Vec3d, 3 >
 ArithVecFloat (doublea) noexcept
 
 ArithVecFloat (doublea, doubleb) noexcept
 
 ArithVecFloat (doublea, doubleb, doublec) noexcept
 
 ArithVecFloat (doublea, doubleb, doublec, doubled) noexcept
 
double length () const
 Compute Euclidean length.
 
void normalize ()
 Normalize vector.
 
void cond_normalize ()
 Conditionally normalize vector. The condition being that the vector has non-zero length.
 
- Public Member Functions inherited from CGLA::ArithVec< double, Vec3d, N >
void set (double_a, double_b)
 Set all coordinates of a 2D vector.
 
void set (double_a, double_b, double_c)
 Set all coordinates of a 3D vector.
 
void set (double_a, double_b, double_c, double_d)
 Set all coordinates of a 4D vector.
 
const double & operator[] (unsigned int i) const
 Const index operator.
 
double & operator[] (unsigned int i)
 Non-const index operator.
 
const double & operator() (unsigned int i) const
 Const index operator.
 
double & operator() (unsigned int i)
 Non-const index operator.
 
double * get ()
 
const double * get () const
 
bool operator== (const Vec3d &v) const
 Equality operator.
 
bool operator== (doublek) const
 Equality wrt scalar. True if all coords are equal to scalar.
 
bool operator!= (const Vec3d &v) const
 Inequality operator.
 
bool operator!= (doublek) const
 Inequality wrt scalar. True if any coord not equal to scalar.
 
bool all_l (const Vec3d &v) const
 
bool all_le (const Vec3d &v) const
 
bool all_g (const Vec3d &v) const
 
bool all_ge (const Vec3d &v) const
 
const Vec3doperator*= (doublek)
 Assignment multiplication with scalar.
 
const Vec3doperator*= (const Vec3d &v)
 
const Vec3doperator/= (doublek)
 Assignment division with scalar.
 
const Vec3doperator/= (const Vec3d &v)
 Assigment division with vector. Each coord divided independently.
 
const Vec3doperator+= (doublek)
 Assignment addition with scalar. Adds scalar to each coordinate.
 
const Vec3doperator+= (const Vec3d &v)
 Assignmment addition with vector.
 
const Vec3doperator-= (doublek)
 Assignment subtraction with scalar. Subtracts scalar from each coord.
 
const Vec3doperator-= (const Vec3d &v)
 Assignment subtraction with vector.
 
const Vec3d operator- () const
 Negate vector.
 
const Vec3d operator- (const Vec3d &v1) const
 Subtract two vectors.
 
const Vec3d operator* (const Vec3d &v1) const
 
const Vec3d operator* (doublek) const
 Multiply scalar onto vector.
 
const Vec3d operator+ (const Vec3d &v1) const
 Add two vectors.
 
const Vec3d operator/ (const Vec3d &v1) const
 Divide two vectors. Each coord separately.
 
const Vec3d operator/ (doublek) const
 Divide vector by scalar.
 
const double min_coord () const
 Return the smallest coordinate of the vector.
 
const double max_coord () const
 Return the largest coordinate of the vector.
 

Additional Inherited Members

- Public Types inherited from CGLA::ArithVec< double, Vec3d, N >
typedef double ScalarType
 For convenience we define a more meaningful name for the scalar type.
 
typedef Vec3d VectorType
 A more meaningful name for vector type.
 
- Static Public Member Functions inherited from CGLA::ArithVec< double, Vec3d, N >
static unsigned int get_dim ()
 Return dimension of vector.
 
- Protected Member Functions inherited from CGLA::ArithVec< double, Vec3d, N >
 ArithVec ()
 Construct uninitialized vector.
 
 ArithVec (double_a)
 Construct a vector where all coordinates are identical.
 
 ArithVec (double_a, double_b)
 Construct a 2D vector.
 
 ArithVec (double_a, double_b, double_c)
 Construct a 3D vector.
 
 ArithVec (double_a, double_b, double_c, double_d)
 Construct a 4D vector.
 
- Protected Attributes inherited from CGLA::ArithVec< double, Vec3d, N >
double data [N]
 The actual contents of the vector.
 

Detailed Description

A 3D double vector.

Useful for high precision arithmetic.


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