Changes in src/vector.cpp [7b36fe:b34306]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/vector.cpp
r7b36fe rb34306 15 15 #include "vector.hpp" 16 16 #include "verbose.hpp" 17 #include "World.hpp" 17 18 18 19 #include <gsl/gsl_linalg.h> … … 26 27 */ 27 28 Vector::Vector() { x[0] = x[1] = x[2] = 0.; }; 29 30 /** Constructor of class vector. 31 */ 32 Vector::Vector(const Vector * const a) 33 { 34 x[0] = a->x[0]; 35 x[1] = a->x[1]; 36 x[2] = a->x[2]; 37 }; 38 39 /** Constructor of class vector. 40 */ 41 Vector::Vector(const Vector &a) 42 { 43 x[0] = a.x[0]; 44 x[1] = a.x[1]; 45 x[2] = a.x[2]; 46 }; 28 47 29 48 /** Constructor of class vector. … … 267 286 }; 268 287 269 /** Calculates the minimum distance of this vector to the plane.288 /** Calculates the minimum distance vector of this vector to the plane. 270 289 * \param *out output stream for debugging 271 290 * \param *PlaneNormal normal of plane 272 291 * \param *PlaneOffset offset of plane 273 * \return distance to plane274 */ 275 double Vector::DistanceToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const292 * \return distance vector onto to plane 293 */ 294 Vector Vector::GetDistanceVectorToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const 276 295 { 277 296 Vector temp; … … 291 310 sign = 0.; 292 311 293 return (temp.Norm()*sign); 312 temp.Normalize(); 313 temp.Scale(sign); 314 return temp; 315 }; 316 317 /** Calculates the minimum distance of this vector to the plane. 318 * \sa Vector::GetDistanceVectorToPlane() 319 * \param *out output stream for debugging 320 * \param *PlaneNormal normal of plane 321 * \param *PlaneOffset offset of plane 322 * \return distance to plane 323 */ 324 double Vector::DistanceToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const 325 { 326 return GetDistanceVectorToPlane(PlaneNormal,PlaneOffset).Norm(); 294 327 }; 295 328
Note:
See TracChangeset
for help on using the changeset viewer.