8#ifndef model_LatticeLine_cpp_
9#define model_LatticeLine_cpp_
11#include <LatticeModule.h>
22 assert(&
P.lattice==&
d.lattice &&
"LatticeVectors have different bases.");
34 const double n = (P0 - Pc).dot(dc) / dc.squaredNorm();
35 return P +
d * lround(n);
42 const double dNorm(dc.norm());
43 assert(dNorm > FLT_EPSILON);
45 return Pc + (P0 - Pc).dot(dc) * dc;
50 assert(&
P.lattice == &P0.lattice &&
"LatticeVectors have different bases.");
ReciprocalLatticeDirectionType cross(const LatticeVectorType &other) const
const LatticeDirectionType d
bool contains(const LatticeVectorType &P0) const
LatticeVectorType snapToLattice(const LatticeVectorType &P0) const
VectorDimD snapToLine(const VectorDimD &P0) const
const LatticeVectorType P
LatticeVectorType::VectorDimD VectorDimD
LatticeVector< 3 > LatticeVectorType
LatticeDirection< 3 > LatticeDirectionType
LatticeLine(const LatticeVectorType &P_in, const LatticeVectorType &d_in)