barycentricTensor transform vector to coordinates is dodgy
The transformation of coordinates to vector looks fine (simply weighting each corner:
template<class Cmpt>
inline Vector<Cmpt> operator&
(
const BarycentricTensor<Cmpt>& T,
const Barycentric<Cmpt>& b
)
{
return Vector<Cmpt>(T.x() & b, T.y() & b, T.z() & b);
}
Can also be expanded as follows:
return Vector<Cmpt>
(
(t.xa()*b2.a() + t.xb()*b2.b() + t.xc()*b2.c() + t.xd()*b2.d()),
(t.ya()*b2.a() + t.yb()*b2.b() + t.yc()*b2.c() + t.yd()*b2.d()),
(t.za()*b2.a() + t.zb()*b2.b() + t.zc()*b2.c() + t.zd()*b2.d())
);
However, the advertised inverse operation:
template<class Cmpt>
inline Barycentric<Cmpt> operator&
(
const Vector<Cmpt>& v,
const BarycentricTensor<Cmpt>& T
)
{
return Barycentric<Cmpt>(v & T.a(), v & T.b(), v & T.c(), v & T.d());
}
Simply makes no sense at all.