function [y,grady]=phiRef(xhat)
% Linear Basis Functions on the reference triangle
y=zeros(3,1); grady=zeros(2,3);
y(1) = 1 - xhat(1) - xhat(2); y(2) = xhat(1); y(3) = xhat(2);
grady(:,1) = [-1; -1]; grady(:,2) = [1; 0]; grady(:,3) = [0; 1];