cgmath
cgmath copied to clipboard
Homogeneous barycentric coordinates
Would it make sense to add conversion to and from barycentric coordinates to cgmath?
FWIW, I kind of like that idea. I implemented barycentric coordinate computation on top of the Vector classes. I'm not sure if it's necessary to implement a new type, since the coordinate system can be represented in a Vector.
Anyway, it's only about 18 lines of code for the entire implementation.
Just the computation would be enough, it's still representable as Vector, as you say.
Would definitely be cool to see! Just wondering if there is a neat way to fit it into the existing algebraic structures...? Would also be great to see use cases for this (also good to note those down in the documentation).