Algorithm Math Delphi

Title: Determine the Incenter of a triangle
Procedure Incenter(x1,y1,x2,y2,x3,y3:Double; Var Px,Py:Double);
Var
Perim : Double;
Side12 : Double;
Side23 : Double;
Side31 : Double;
Begin
Side12 := Distance(x1,y1,x2,y2);
Side23 := Distance(x2,y2,x3,y3);
Side31 := Distance(x3,y3,x1,y1);
{ using Heron's S=UR }
Perim := 1/(Side12+Side23+Side31);
Px := (Side23*x1+Side31*x2+Side12*x3)*Perim;
Py := (Side23*y1+Side31*y2+Side12*y3)*Perim;
End;
(* End Of Incenter *)