13 using T =
typename V::ValueType;
17 constexpr Line() noexcept = default;
18 constexpr
Line( const V &
p, const V &
d ) noexcept :
p(
p ),
d(
d ) { }
20 constexpr explicit Line(
const Line<U> & l ) noexcept :
p( l.p ),
d( l.d ) { }
27 {
return ( x -
project( x ) ).lengthSq(); }
37 [[nodiscard]] V
project(
const V & x )
const {
return p + dot(
d, x -
p ) /
d.lengthSq() *
d; }
55 return a.
p == b.
p && a.
d == b.
d;
MRMESH_API bool operator==(const BitSet &a, const BitSet &b)
compare that two bit sets have the same set bits (they can be equal even if sizes are distinct but la...
Definition MRCameraOrientationPlugin.h:8
Definition MRMesh/MRAffineXf.h:14
M A
Definition MRMesh/MRAffineXf.h:18
typename V::ValueType T
Definition MRLine.h:13
const Line & operator+() const
returns same representation
Definition MRLine.h:32
T distanceSq(const V &x) const
returns squared distance from given point to this line
Definition MRLine.h:26
constexpr Line(const Line< U > &l) noexcept
Definition MRLine.h:20
Line operator-() const
returns same line represented with flipped direction of d-vector
Definition MRLine.h:30
constexpr Line() noexcept=default
V operator()(T param) const
returns point on the line, where param=0 returns p and param=1 returns p+d
Definition MRLine.h:23
V d
Definition MRLine.h:15
Line< V > transformed(const Line< V > &l, const AffineXf< V > &xf)
Definition MRLine.h:47
Line normalized() const
returns same line represented with unit d-vector
Definition MRLine.h:34
V p
Definition MRLine.h:15
V project(const V &x) const
finds the closest point on line
Definition MRLine.h:37