Changeset 57cfb7 for molecuilder/src/vector.cpp
- Timestamp:
- Oct 13, 2009, 4:42:58 PM (16 years ago)
- Children:
- 6f9d14, 96d8dc
- Parents:
- 9f73db
- git-author:
- Frederik Heber <heber@…> (10/13/09 16:14:49)
- git-committer:
- Frederik Heber <heber@…> (10/13/09 16:42:58)
- File:
-
- 1 edited
-
molecuilder/src/vector.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/vector.cpp
r9f73db r57cfb7 256 256 return false; 257 257 } 258 }; 259 260 /** Calculates the minimum distance of this vector to the plane. 261 * \param *out output stream for debugging 262 * \param *PlaneNormal normal of plane 263 * \param *PlaneOffset offset of plane 264 * \return distance to plane 265 */ 266 double Vector::DistanceToPlane(ofstream *out, Vector *PlaneNormal, Vector *PlaneOffset) 267 { 268 Vector temp; 269 270 // first create part that is orthonormal to PlaneNormal with withdraw 271 temp.CopyVector(this); 272 temp.SubtractVector(PlaneOffset); 273 temp.MakeNormalVector(PlaneNormal); 274 temp.Scale(-1.); 275 // then add connecting vector from plane to point 276 temp.AddVector(this); 277 temp.SubtractVector(PlaneOffset); 278 279 return temp.Norm(); 258 280 }; 259 281
Note:
See TracChangeset
for help on using the changeset viewer.
