Graphic Delphi

Title: Determine if two 2D segments are perpendicular to each other
Function SegmentsPerpendicular(x1,y1,x2,y2,x3,y3,x4,y4:Double):Boolean;
Begin
Result:= IsEqual((y2-y1)*(x3-x4),(y4-y3)*(x2-x1)*-1);
End;
(* End Of SegmentsPerpendicular *)

Const Epsilon = 1.0E-12;

Function IsEqual(Val1,Val2:Double):Boolean;
Var Delta:Double;
Begin
Delta := Abs(Val1-Val2);
Result := (Delta Epsilon);
End;
(* End Of Not Equal *)