Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Sphere.h

Go to the documentation of this file.
00001 //  $Id: Sphere.h,v 1.2 2000/01/18 00:42:09 burnett Exp $
00002 //
00003 //
00004 
00005 #ifndef __SPHERE_H
00006 #define __SPHERE_H
00007 
00008 #include "geometry/Surface.h"
00009 
00011 class Sphere: public Surface
00012 {
00013     
00014 public:
00015     // specify origin, radius 
00016     Sphere( const Point& o,  double radius );
00017     
00018     
00019     virtual double how_near( const Point& x ) const;
00020     virtual double distance( const Point& x ,const Vector& v, int ) const;
00021 
00022     virtual Vector normal( const Point& x )const;
00023     // returns normal-vector at Point x, assuming x to be "on" the surface
00024     // specify geometry
00025     
00026     
00027     double radius()const{return _radius;}
00028     // radius
00029     
00030     virtual const char *nameOf() const { return "Sphere"; }
00031     virtual void printOn( std::ostream& os = std::cout ) const;
00032     
00033     
00034 private:
00035     
00036     double _radius;
00037     // radius           
00038 };
00039 
00040 #endif
00041 

Generated at Wed Nov 21 12:20:12 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000