dpoint3.h File Reference

#include "GeomExport.h"
#include "maxheap.h"
#include "point3.h"
#include "assert1.h"
#include <iosfwd>

Classes

class  DPoint3
 class DPoint3 Description: This class describes a 3D point using double precision x, y and z coordinates. More...
 
class  DRay
 

Functions

double Length (const DPoint3 &)
 Returns the 'Length' of the point. More...
 
int MaxComponent (const DPoint3 &)
 Returns the component with the maximum absolute value. More...
 
int MinComponent (const DPoint3 &)
 Returns the component with the minimum absolute value. More...
 
DPoint3 Normalize (const DPoint3 &)
 Returns a unit vector. More...
 
DPoint3 operator* (double, const DPoint3 &)
 
DPoint3 operator* (const DPoint3 &, double)
 
DPoint3 operator/ (const DPoint3 &, double)
 
std::ostream & operator<< (std::ostream &, const DPoint3 &)
 
DPoint3 CrossProd (const DPoint3 &a, const DPoint3 &b)
 Returns the cross product of two DPoint3s. More...
 
double DotProd (const DPoint3 &a, const DPoint3 &b)
 Returns the dot product of two DPoint3s. More...
 

Function Documentation

double Length ( const DPoint3 v)
inline

Returns the 'Length' of the point.

This is sqrt(v.x*v.x+v.y*v.y+v.z*v.z)

153  {
154  return (double)sqrt(v.x*v.x+v.y*v.y+v.z*v.z);
155  }
double y
Definition: dpoint3.h:26
double z
Definition: dpoint3.h:26
double x
Definition: dpoint3.h:26
int MaxComponent ( const DPoint3 )

Returns the component with the maximum absolute value.

0=x, 1=y, 2=z.

int MinComponent ( const DPoint3 )

Returns the component with the minimum absolute value.

0=x, 1=y, 2=z.

DPoint3 Normalize ( const DPoint3 )

Returns a unit vector.

This is a DPoint3 with each component divided by the point Length().

DPoint3 operator* ( double  f,
const DPoint3 a 
)
inline
197  {
198  return(DPoint3(a.x*f, a.y*f, a.z*f));
199  }
double y
Definition: dpoint3.h:26
double z
Definition: dpoint3.h:26
double x
Definition: dpoint3.h:26
class DPoint3 Description: This class describes a 3D point using double precision x...
Definition: dpoint3.h:24
DPoint3 operator* ( const DPoint3 a,
double  f 
)
inline
201  {
202  return(DPoint3(a.x*f, a.y*f, a.z*f));
203  }
double y
Definition: dpoint3.h:26
double z
Definition: dpoint3.h:26
double x
Definition: dpoint3.h:26
class DPoint3 Description: This class describes a 3D point using double precision x...
Definition: dpoint3.h:24
DPoint3 operator/ ( const DPoint3 a,
double  f 
)
inline
205  {
206  return(DPoint3(a.x/f, a.y/f, a.z/f));
207  }
double y
Definition: dpoint3.h:26
double z
Definition: dpoint3.h:26
double x
Definition: dpoint3.h:26
class DPoint3 Description: This class describes a 3D point using double precision x...
Definition: dpoint3.h:24
std::ostream& operator<< ( std::ostream &  ,
const DPoint3  
)
DPoint3 CrossProd ( const DPoint3 a,
const DPoint3 b 
)

Returns the cross product of two DPoint3s.

double DotProd ( const DPoint3 a,
const DPoint3 b 
)

Returns the dot product of two DPoint3s.