00001 #ifndef Pv_Point_Included 00002 #define Pv_Point_Included 00003 00004 #include <iostream> 00005 #include <cmath> 00006 00007 class Pv_Point{ 00008 public: 00009 double x; 00010 double y; 00011 double z; 00012 /*constructors*/ 00013 Pv_Point(); 00014 Pv_Point(double x,double y,double z); 00015 Pv_Point(Pv_Point *the_point); 00016 Pv_Point(const Pv_Point& the_point); 00017 00018 void equals(Pv_Point *the_point); 00019 void equals(const Pv_Point& the_point); 00020 00021 /*get and set*/ 00022 double get_x() const; 00023 double get_y() const; 00024 double get_z() const; 00025 void set_x(double x); 00026 void set_y(double y); 00027 void set_z(double z); 00028 00029 /*misc*/ 00030 void draw(); 00031 void draw_sphere(); 00032 00033 /*test*/ 00034 00035 /*operators*/ 00036 Pv_Point operator/ (double d); 00037 Pv_Point operator- (Pv_Point p); 00038 Pv_Point operator^ (Pv_Point p); /*vectoriel product*/ 00039 double operator* (Pv_Point p); /*scalar product*/ 00040 Pv_Point operator+ (Pv_Point p); 00041 Pv_Point operator* (double t); 00042 void normal(); 00043 }; 00044 00045 /*test*/ 00046 std::ostream& operator<< (std::ostream& s,const Pv_Point& z); 00047 00048 /*operators*/ 00049 double length(Pv_Point the_point); 00050 Pv_Point operator*(double f,Pv_Point p); 00051 Pv_Point normalize(Pv_Point p); 00052 Pv_Point perpendicular(Pv_Point p); 00053 Pv_Point operator- (Pv_Point p); 00054 00055 #endif 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065
1.2.18