00001
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
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
00024
00025
00026
00027 double radius()const{return _radius;}
00028
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
00038 };
00039
00040 #endif
00041