vtf-logo

Point.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00008 #if !defined(__geom_Point_h__)
00009 #define __geom_Point_h__
00010 
00011 // If we are debugging the whole geom namespace.
00012 #if defined(DEBUG_geom) && !defined(DEBUG_Point)
00013 #define DEBUG_Point
00014 #endif
00015 
00016 #ifdef DEBUG_Point
00017 #ifndef DEBUG_FixedArray
00018 #define DEBUG_FixedArray
00019 #endif
00020 #endif
00021 
00022 #include "../defs.h"
00023 
00024 #include "../../ads/array/FixedArray.h"
00025 
00026 BEGIN_NAMESPACE_GEOM
00027 
00042 //-----------------------------------------------------------------------------
00044 // @{
00045 
00046 
00048 
00051 template<int N, typename T>
00052 T
00053 computeDotProduct(const ads::FixedArray<N,T>& x, 
00054                   const ads::FixedArray<N,T>& y);
00055 
00056 
00058 template<typename T>
00059 ads::FixedArray<3,T>
00060 computeCrossProduct(const ads::FixedArray<3,T>& x, 
00061                     const ads::FixedArray<3,T>& y);
00062 
00063     
00065 
00069 template<typename T>
00070 void
00071 computeCrossProduct(const ads::FixedArray<3,T>& x, 
00072                     const ads::FixedArray<3,T>& y,
00073                     ads::FixedArray<3,T>* result);
00074 
00075     
00077 template<typename T>
00078 T 
00079 computeTripleProduct(const ads::FixedArray<3,T>& a, 
00080                      const ads::FixedArray<3,T>& b, 
00081                      const ads::FixedArray<3,T>& c);
00082 
00083 
00085 template<typename T>
00086 T 
00087 computeDiscriminant(const ads::FixedArray<2,T>& p, 
00088                     const ads::FixedArray<2,T>& q);
00089 
00090 
00092 template<typename T>
00093 void
00094 computeAnOrthogonalVector(const ads::FixedArray<3,T>& vector,
00095                           ads::FixedArray<3,T>* orthogonal);
00096 
00097 
00098 // @}
00099 //-----------------------------------------------------------------------------
00101 // @{
00102 
00103 
00105 template<int N, typename T>
00106 T 
00107 computeSquaredMagnitude(const ads::FixedArray<N,T>& x);
00108 
00109 
00111 template<int N, typename T>
00112 T 
00113 computeMagnitude(const ads::FixedArray<N,T>& x);
00114 
00115 
00117 template<int N, typename T>
00118 void 
00119 normalize(ads::FixedArray<N,T>* x);
00120 
00121 
00122 // @}
00123 //-----------------------------------------------------------------------------
00125 // @{
00126 
00127   
00129 
00132 template<int N, typename T>
00133 T 
00134 computeSquaredDistance(const ads::FixedArray<N,T>& p, 
00135                        const ads::FixedArray<N,T>& q);
00136 
00137 
00138 // @}
00139 //-----------------------------------------------------------------------------
00141 // @{
00142 
00143 
00145 template<typename T>
00146 int 
00147 computeSignOfTurn(const ads::FixedArray<2,T>& p, 
00148                   const ads::FixedArray<2,T>& q, 
00149                   const ads::FixedArray<2,T>& r);
00150 
00151 
00152 // CONTINUE: perhaps replace this with something better.
00154 template<typename T>
00155 int 
00156 computeApproximateSignOfTurn(const ads::FixedArray<2,T>& p, 
00157                              const ads::FixedArray<2,T>& q, 
00158                              const ads::FixedArray<2,T>& r);
00159 
00160 
00162 template<typename T>
00163 T 
00164 computePseudoAngle(const ads::FixedArray<2,T>& vec);
00165 
00166 
00167 // CONTINUE: Check the implementation.
00169 
00172 template<int N, typename T>
00173 T
00174 computeAngle(const ads::FixedArray<N,T>& a, const ads::FixedArray<N,T>& b);
00175 
00176 
00177 // @}
00178 //-----------------------------------------------------------------------------
00180 // @{
00181 
00182 
00184 template<typename T>
00185 void 
00186 rotatePiOver2(ads::FixedArray<2,T>* p);
00187 
00188   
00190 template<typename T>
00191 void 
00192 rotateMinusPiOver2(ads::FixedArray<2,T>& p);
00193 
00194 
00195 // @}
00196   
00197 END_NAMESPACE_GEOM
00198 
00199 #define __geom_Point_ipp__
00200 #include "Point.ipp"
00201 #undef __geom_Point_ipp__
00202 
00203 #endif

Generated on Fri Aug 24 12:55:56 2007 for Computational Geometry Package by  doxygen 1.4.7