Skip to content
Snippets Groups Projects
Commit 46fe369d authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Implement projectOntoNormalSpace and the Weingarten map

[[Imported from SVN: r9449]]
parent 69828eec
No related branches found
No related tags found
No related merge requests found
...@@ -245,9 +245,64 @@ public: ...@@ -245,9 +245,64 @@ public:
/** \brief Project tangent vector of R^n onto the tangent space */ /** \brief Project tangent vector of R^n onto the tangent space */
EmbeddedTangentVector projectOntoTangentSpace(const EmbeddedTangentVector& v) const { EmbeddedTangentVector projectOntoTangentSpace(const EmbeddedTangentVector& v) const {
DUNE_THROW(Dune::NotImplemented, "!"); EmbeddedTangentVector result;
// translation part
for (int i=0; i<N; i++)
result[i] = v[i];
// rotation part
typename Rotation<T,N>::EmbeddedTangentVector rotV;
for (int i=0; i<Rotation<T,N>::embeddedDim; i++)
rotV[i] = v[i+N];
rotV = q.projectOntoTangentSpace(rotV);
for (int i=0; i<Rotation<T,N>::embeddedDim; i++)
result[i+N] = rotV[i];
return result;
} }
/** \brief Project tangent vector of R^n onto the normal space space */
EmbeddedTangentVector projectOntoNormalSpace(const EmbeddedTangentVector& v) const {
EmbeddedTangentVector result;
// translation part
for (int i=0; i<N; i++)
result[i] = v[i];
// rotation part
T sp = 0;
for (int i=0; i<Rotation<T,N>::embeddedDim; i++)
sp += v[i+N] * q[i];
for (int i=0; i<Rotation<T,N>::embeddedDim; i++)
result[i+N] = sp * q[i];
return result;
}
/** \brief The Weingarten map */
EmbeddedTangentVector weingarten(const EmbeddedTangentVector& z, const EmbeddedTangentVector& v) const {
EmbeddedTangentVector result;
// translation part: nothing, the space is flat
for (int i=0; i<N; i++)
result[i] = 0;
// rotation part
T sp = 0;
for (int i=0; i<Rotation<T,N>::embeddedDim; i++)
sp += v[i+N] * q[i];
for (int i=0; i<Rotation<T,N>::embeddedDim; i++)
result[i+N] = -sp * z[i+N];
return result;
}
/** \brief Compute an orthonormal basis of the tangent space of SE(3). /** \brief Compute an orthonormal basis of the tangent space of SE(3).
......
...@@ -335,6 +335,36 @@ public: ...@@ -335,6 +335,36 @@ public:
return result; return result;
} }
/** \brief Project tangent vector of R^n onto the normal space space */
EmbeddedTangentVector projectOntoNormalSpace(const EmbeddedTangentVector& v) const {
EmbeddedTangentVector result;
T sp = 0;
for (int i=0; i<N; i++)
sp += v[i] * data_[i];
for (int i=0; i<N; i++)
result[i] = sp * data_[i];
return result;
}
/** \brief The Weingarten map */
EmbeddedTangentVector weingarten(const EmbeddedTangentVector& z, const EmbeddedTangentVector& v) const {
EmbeddedTangentVector result;
T sp = 0;
for (int i=0; i<N; i++)
sp += v[i] * data_[i];
for (int i=0; i<N; i++)
result[i] = -sp * z[i];
return result;
}
/** \brief The global coordinates, if you really want them */ /** \brief The global coordinates, if you really want them */
const CoordinateType& globalCoordinates() const { const CoordinateType& globalCoordinates() const {
return data_; return data_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment