Changeset 54de04 for molecuilder
- Timestamp:
- Jul 7, 2009, 8:12:28 AM (16 years ago)
- Children:
- d98327
- Parents:
- eeae5b
- File:
-
- 1 edited
-
molecuilder/src/vector.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/vector.cpp
reeae5b r54de04 259 259 double Vector::Angle(const Vector *y) const 260 260 { 261 return acos(this->ScalarProduct(y)/Norm()/y->Norm()); 261 double angle = this->ScalarProduct(y)/Norm()/y->Norm(); 262 // -1-MYEPSILON occured due to numerical imprecision, catch ... 263 //cout << Verbose(2) << "INFO: acos(-1) = " << acos(-1) << ", acos(-1+MYEPSILON) = " << acos(-1+MYEPSILON) << ", acos(-1-MYEPSILON) = " << acos(-1-MYEPSILON) << "." << endl; 264 if (angle < -1) 265 angle = -1; 266 if (angle > 1) 267 angle = 1; 268 return acos(angle); 262 269 }; 263 270
Note:
See TracChangeset
for help on using the changeset viewer.
