Changes in src/vector.cpp [d09ff7:29812d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/vector.cpp
rd09ff7 r29812d 225 225 Direction.CopyVector(LineVector); 226 226 Direction.SubtractVector(Origin); 227 Direction.Normalize();228 227 //*out << Verbose(4) << "INFO: Direction is " << Direction << "." << endl; 229 228 factor = Direction.ScalarProduct(PlaneNormal); … … 235 234 helper.SubtractVector(Origin); 236 235 factor = helper.ScalarProduct(PlaneNormal)/factor; 237 if (factor < MYEPSILON) { // Origin is in-plane238 //*out << Verbose(2) << "Origin of line is in-plane, simple." << endl;239 CopyVector(Origin);240 return true;241 }242 236 //factor = Origin->ScalarProduct(PlaneNormal)*(-PlaneOffset->ScalarProduct(PlaneNormal))/(Direction.ScalarProduct(PlaneNormal)); 243 237 Direction.Scale(factor); … … 661 655 }; 662 656 663 /** Given a box by its matrix \a *M and its inverse *Minv the vector is made to point within that box.664 * \param *M matrix of box665 * \param *Minv inverse matrix666 */667 void Vector::WrapPeriodically(const double *M, const double *Minv)668 {669 MatrixMultiplication(Minv);670 // truncate to [0,1] for each axis671 for (int i=0;i<NDIM;i++) {672 x[i] += 0.5; // set to center of box673 while (x[i] >= 1.)674 x[i] -= 1.;675 while (x[i] < 0.)676 x[i] += 1.;677 }678 MatrixMultiplication(M);679 };680 681 657 /** Do a matrix multiplication. 682 658 * \param *matrix NDIM_NDIM array 683 659 */ 684 void Vector::MatrixMultiplication( constdouble *M)660 void Vector::MatrixMultiplication(double *M) 685 661 { 686 662 Vector C; … … 724 700 * \param *matrix NDIM_NDIM array 725 701 */ 726 void Vector::InverseMatrixMultiplication( constdouble *A)702 void Vector::InverseMatrixMultiplication(double *A) 727 703 { 728 704 Vector C;
Note:
See TracChangeset
for help on using the changeset viewer.