Commit 9e84f04d authored by Thibault Lejemble's avatar Thibault Lejemble

add normal method

parent 21ec2225
......@@ -104,6 +104,9 @@ public:
/*! \brief Returns the derivatives of the scalar field at the evaluation point */
MULTIARCH inline ScalarArray dPotential() const;
/*! \brief Value of the normal of the primitive at the evaluation point */
MULTIARCH inline VectorType normal() const;
/*! \brief Returns the second derivatives of the scalar field at the evaluation point */
MULTIARCH inline VectorArray dNormal() const;
......
......@@ -166,6 +166,14 @@ MlsSphereFitDer<DataPoint, _WFunctor, T>::dPotential() const
return result;
}
template < class DataPoint, class _WFunctor, typename T>
typename MlsSphereFitDer<DataPoint, _WFunctor, T>::VectorType
MlsSphereFitDer<DataPoint, _WFunctor, T>::normal() const
{
VectorType grad = Base::m_dUc.template tail<Dim>().transpose() + Base::m_ul;
return grad.normalized();
}
template < class DataPoint, class _WFunctor, typename T>
typename MlsSphereFitDer<DataPoint, _WFunctor, T>::VectorArray
MlsSphereFitDer<DataPoint, _WFunctor, T>::dNormal() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment