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

point3d.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------
00002 //               The Motion Strategy Library (MSL)
00003 //----------------------------------------------------------------------
00004 //
00005 // Copyright (c) University of Illinois and Steven M. LaValle.     
00006 // All Rights Reserved.
00007 //
00008 // Permission to use, copy, and distribute this software and its
00009 // documentation is hereby granted free of charge, provided that
00010 // (1) it is not a component of a commercial product, and
00011 // (2) this notice appears in all copies of the software and
00012 //     related documentation.
00013 //
00014 // The University of Illinois and the author make no representations
00015 // about the suitability or fitness of this software for any purpose.
00016 // It is provided "as is" without express or implied warranty.
00017 //----------------------------------------------------------------------
00018 
00019 #ifndef MSL_POINT3D_H
00020 #define MSL_POINT3D_H
00021 
00022 #include <stream.h>
00023 #include <list.h>
00024 
00025 
00026 class MSLPoint3d
00027 {
00028   double xrep;
00029   double yrep;
00030   double zrep;
00031 
00032 public:
00033   
00034   MSLPoint3d();
00035   MSLPoint3d(double x, double y, double z);
00036   ~MSLPoint3d() {}
00037   double  xcoord()  const   { return xrep; }
00038   double  ycoord()  const   { return yrep; }
00039   double  zcoord()  const   { return zrep; }
00040   double  W()   const   { return 1; }
00041   double  WD()  const   { return 1; }
00042   int     dim() const { return 3; }
00043   double  sqr_dist(const MSLPoint3d& q) const;
00044   double xdist(const MSLPoint3d& q) const;
00045   double ydist(const MSLPoint3d& q) const;
00046   double zdist(const MSLPoint3d& q) const;
00047   double  distance(const MSLPoint3d& q) const;
00048   MSLPoint3d translate(double dx, double dy, double dz) const;
00049   MSLPoint3d reflect(const MSLPoint3d& q, const MSLPoint3d& r, 
00050                      const MSLPoint3d& s) const;
00051   MSLPoint3d reflect(const MSLPoint3d& q) const;
00052   bool operator==(const MSLPoint3d& q) const;
00053   bool operator!=(const MSLPoint3d& q)  const { return !operator==(q);}
00054   friend ostream& operator<<(ostream& O, const MSLPoint3d& p) ;
00055   friend istream& operator>>(istream& I, MSLPoint3d& p) ;
00056   friend istream& operator>>(istream& is, list<MSLPoint3d> & vl);
00057   friend ostream& operator<<(ostream& os, const list<MSLPoint3d> & vl);
00058 };
00059 
00060 #endif
00061 
00062 
00063 
00064 
00065 
Motion Strategy Library


Web page maintained by Steve LaValle
Partial support provided by NSF CAREER Award IRI-970228 (LaValle), Honda Research.
Contributors: Anna Atramentov, Peng Cheng, James Kuffner, Steve LaValle, and Libo Yang.