dpoint3.h File Reference

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 &)
 
Point3 Point3FromDPoint3 (const DPoint3 &from)
 
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)

155  {
156  return (double)sqrt(v.x*v.x+v.y*v.y+v.z*v.z);
157  }
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
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
DPoint3 operator/ ( const DPoint3 a,
double  f 
)
inline
209  {
210  DbgAssert(f != 0.0);
211  double invF = 1.0 / f; // Mimic 2019 behavior
212  return(DPoint3(a.x * invF, a.y * invF, a.z * invF));
213  }
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
#define DbgAssert(expr)
Definition: assert1.h:72
std::ostream& operator<< ( std::ostream &  ,
const DPoint3  
)
Point3 Point3FromDPoint3 ( const DPoint3 from)
inline
217 {
218  return Point3(from.x, from.y, from.z);
219 }
double y
Definition: dpoint3.h:26
double z
Definition: dpoint3.h:26
Definition: point3.h:55
double x
Definition: dpoint3.h:26
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.