Changeset bc3953 for molecuilder/src/vector.cpp
- Timestamp:
- Aug 20, 2009, 3:40:49 PM (16 years ago)
- Children:
- 2aea0b, 390a2b
- Parents:
- 6c6d84
- File:
-
- 1 edited
-
molecuilder/src/vector.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/vector.cpp
r6c6d84 rbc3953 1221 1221 return true; 1222 1222 }; 1223 1224 /** 1225 * Checks whether this vector is within the parallelepiped defined by the given three vectors and 1226 * their offset. 1227 * 1228 * @param offest for the origin of the parallelepiped 1229 * @param three vectors forming the matrix that defines the shape of the parallelpiped 1230 */ 1231 bool Vector::IsInParallelepiped(Vector offset, double *parallelepiped) 1232 { 1233 Vector a; 1234 a.CopyVector(this); 1235 a.SubtractVector(&offset); 1236 a.InverseMatrixMultiplication(parallelepiped); 1237 bool isInside = true; 1238 1239 for (int i=NDIM;i--;) 1240 isInside = isInside && ((a.x[i] <= 1) && (a.x[i] >= 0)); 1241 1242 return isInside; 1243 }
Note:
See TracChangeset
for help on using the changeset viewer.
