Back to index

extremetuxracer  0.5beta
Public Member Functions | Static Public Member Functions | Public Attributes
pp::Plane Class Reference

#include <plane.h>

Collaboration diagram for pp::Plane:
Collaboration graph

List of all members.

Public Member Functions

 Plane (void)
 Plane (const double x, const double y, const double z, const double d)
double distance (const Vec3d &point) const

Static Public Member Functions

static bool intersect (const Plane &s1, const Plane &s2, const Plane &s3, Vec3d *p)

Public Attributes

Vec3d nml
double d

Detailed Description

Definition at line 28 of file plane.h.

Constructor & Destructor Documentation

pp::Plane::Plane ( void  ) [inline]

Definition at line 31 of file plane.h.

pp::Plane::Plane ( const double  x,
const double  y,
const double  z,
const double  d 

Definition at line 31 of file plane.cpp.


Member Function Documentation

double pp::Plane::distance ( const Vec3d point) const

Definition at line 39 of file plane.cpp.

       return        nml.x * point.x +
                     nml.y * point.y +
                     nml.z * point.z +

Here is the caller graph for this function:

bool pp::Plane::intersect ( const Plane s1,
const Plane s2,
const Plane s3,
Vec3d p 
) [static]

Definition at line 49 of file plane.cpp.

       double A[3][4];
    double x[3];
    double retval;

    A[0][0] =  s1.nml.x;
    A[0][1] =  s1.nml.y;
    A[0][2] =  s1.nml.z;
    A[0][3] = -s1.d;

    A[1][0] =  s2.nml.x;
    A[1][1] =  s2.nml.y;
    A[1][2] =  s2.nml.z;
    A[1][3] = -s2.d;

    A[2][0] =  s3.nml.x;
    A[2][1] =  s3.nml.y;
    A[2][2] =  s3.nml.z;
    A[2][3] = -s3.d;

    retval = gauss( (double*) A, 3, x);

    if ( retval != 0 ) {
       /* Matrix is singular */
       return false;
    } else {
       /* Solution found */
       p->x = x[0];
       p->y = x[1];
       p->z = x[2];
       return true;

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

double pp::Plane::d

Definition at line 38 of file plane.h.

Definition at line 37 of file plane.h.

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