TizzyT

CirclesIntersect

Jul 13th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.45 KB | None | 0 0
  1.     Public Function CirclesIntersect(ByVal C1X As Double, C1Y As Double, ByVal C1R As Double, _
  2.                                      ByVal C2X As Double, C2Y As Double, ByVal C2R As Double) As Boolean
  3.         Dim Width As Double = Math.Abs(C1X - C2X)
  4.         Dim Height As Double = Math.Abs(C1Y - C2Y)
  5.         Dim Distance As Double = Math.Sqrt((Width ^ 2) + (Height ^ 2))
  6.         If C1R + C2R >= Distance Then Return True Else Return False
  7.     End Function
Advertisement
Add Comment
Please, Sign In to add comment