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

A four dimensional floating point vector. More...

#include <Vec4d.h>

Inheritance diagram for CGLA::Vec4d:
CGLA::ArithVec4Float< double, Vec4d > CGLA::ArithVecFloat< double, Vec4d, 4 > CGLA::ArithVec< double, Vec4d, N >

Public Member Functions

 Vec4d () noexcept
 Construct a (0,0,0,0) homogenous Vector.
 
 Vec4d (double _a) noexcept
 Construct a (0,0,0,0) homogenous Vector.
 
 Vec4d (double _a, double _b, double _c, double _d) noexcept
 Construct a 4D vector.
 
 Vec4d (double _a, double _b, double _c) noexcept
 Construct a homogenous vector (a,b,c,1)
 
 Vec4d (const Vec3d &v) noexcept
 Construct a homogenous vector from a non-homogenous.
 
 Vec4d (const Vec3d &v, double _d) noexcept
 Construct a homogenous vector from a non-homogenous.
 
 operator Vec3d () const noexcept
 
- Public Member Functions inherited from CGLA::ArithVec4Float< double, Vec4d >
 ArithVec4Float () noexcept
 Construct a (0,0,0,0) homogenous Vector.
 
 ArithVec4Float (doublea, doubleb, doublec, doubled) noexcept
 Construct a 4D vector.
 
void de_homogenize ()
 Divide all coordinates by the fourth coordinate.
 
- Public Member Functions inherited from CGLA::ArithVecFloat< double, Vec4d, 4 >
 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, Vec4d, 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 Vec4d &v) const
 Equality operator.
 
bool operator== (doublek) const
 Equality wrt scalar. True if all coords are equal to scalar.
 
bool operator!= (const Vec4d &v) const
 Inequality operator.
 
bool operator!= (doublek) const
 Inequality wrt scalar. True if any coord not equal to scalar.
 
bool all_l (const Vec4d &v) const
 
bool all_le (const Vec4d &v) const
 
bool all_g (const Vec4d &v) const
 
bool all_ge (const Vec4d &v) const
 
const Vec4doperator*= (doublek)
 Assignment multiplication with scalar.
 
const Vec4doperator*= (const Vec4d &v)
 
const Vec4doperator/= (doublek)
 Assignment division with scalar.
 
const Vec4doperator/= (const Vec4d &v)
 Assigment division with vector. Each coord divided independently.
 
const Vec4doperator+= (doublek)
 Assignment addition with scalar. Adds scalar to each coordinate.
 
const Vec4doperator+= (const Vec4d &v)
 Assignmment addition with vector.
 
const Vec4doperator-= (doublek)
 Assignment subtraction with scalar. Subtracts scalar from each coord.
 
const Vec4doperator-= (const Vec4d &v)
 Assignment subtraction with vector.
 
const Vec4d operator- () const
 Negate vector.
 
const Vec4d operator- (const Vec4d &v1) const
 Subtract two vectors.
 
const Vec4d operator* (const Vec4d &v1) const
 
const Vec4d operator* (doublek) const
 Multiply scalar onto vector.
 
const Vec4d operator+ (const Vec4d &v1) const
 Add two vectors.
 
const Vec4d operator/ (const Vec4d &v1) const
 Divide two vectors. Each coord separately.
 
const Vec4d 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, Vec4d, N >
typedef double ScalarType
 For convenience we define a more meaningful name for the scalar type.
 
typedef Vec4d VectorType
 A more meaningful name for vector type.
 
- Static Public Member Functions inherited from CGLA::ArithVec< double, Vec4d, N >
static unsigned int get_dim ()
 Return dimension of vector.
 
- Protected Member Functions inherited from CGLA::ArithVec< double, Vec4d, 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, Vec4d, N >
double data [N]
 The actual contents of the vector.
 

Detailed Description

A four dimensional floating point vector.

This class is also used (via typedef) for homogeneous vectors.


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