Mega Code Archive

 
Categories / Delphi / Graphic
 

How to determine if two 2D segments are perpendicular

Title: How to determine if two 2D segments are perpendicular function SegmentsPerpendicular(x1, y1, x2, y2, x3, y3, x4, y4: Double): Boolean; begin Result := (((y2 - y1) * (x3 - x4)) = ((y4 - y3) * (x2 - x1) * -1)); end; (* End Of SegmentsPerpendicular *)