D-dimensional barycentric coordinates (C implementation)