Mega Code Archive

 
Categories / Delphi / Graphic
 

Determine if two 2D segments are parallel to each other

Title: Determine if two 2D segments are parallel to each other Function SegmentsParallel(x1,y1,x2,y2,x3,y3,x4,y4:Double):Boolean; Begin Result := IsEqual(((y1-y2)*(x1-x2)),((y3-y4)*(x3-x4))); End; (* End Of SegmentsParallel *) Const Epsilon = 1.0E-12; Function IsEqual(Val1,Val2:Double):Boolean; Var Delta:Double; Begin Delta := Abs(Val1-Val2); Result := (Delta