computing barycentric coordinates