add function to calculate barycentric coordinates
use barycentric function for interpolation