BugInTheSYS

Untitled

Dec 11th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Function Intersect( ByVal VecLine1 As VectorLine2, ByVal VecLine2 As VectorLine2 ) As Boolean
  2.     Dim Numerator, Denominator, u As Single
  3.     Denominator = ( VecLine2.Vec.Y * VecLine1.Vec.X + VecLine2.Vec.X * VecLine1.Vec.Y )
  4.     If( Denominator = 0 ) Then
  5.       Return False
  6.     End If
  7.     Numerator = ( VecLine2.Vec.X * ( VecLine1.Base.y - VecLine2.Base.Y ) - VecLine2.Vec.Y * ( VecLine1.Base.Y - VecLine2.Base.X ) )
  8.     u = Numerator / Denominator
  9.     Return Not( u < 0 Or u > 1 )
  10.   End Function
  11.  
Advertisement
Add Comment
Please, Sign In to add comment