function A = trianglearea(p1,p2,p3);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% trianglearea.m                 %
% written 2/28/00 by ben olding  %
% finds area of triangle         %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% A = 0.5*b*h
%   = 0.5*b*sin(theta)*a
%   = 0.5*(b cross a)

nrm =cross(p2-p1,p3-p1); 
A=abs(0.5*sqrt(nrm(1).^2+nrm(2).^2+nrm(3).^2));
