Barycentric coordinates (part of solution to practice examination)