PointIntersectCircle
Result = PointIntersectCircle(PointX, PointY, CircleX, CircleY, CircleRadius)
 
Parameters:

    PointX = X-position of the point
    PointY = Y-position of the point
    CircleX = X-position of the circle
    CircleY = Y-position of the circle
    CircleRadius= radius of the circle
Returns:

    Result
 

      CirclesIntersect checks if a specified point intersects a circle. The function returns 1 if an intersection has occurred, otherwise it returns 0.



Mini Tutorial:


      Show the use of CirclesIntersect

  
; Calculate position of main circle
  HCentre = GetScreenWidth() / 2 - 20
  VCentre = GetScreenHeight() / 2 - 20
  
  Repeat
     Cls RGB(0,0,0)
   ; Draw a circle
     Circle HCentre, VCentre, 400
   ; Check for Intersection with mouse position
     If PointIntersectCircle(MouseX(), MouseY(), HCentre, VCentre, 40)
        Print "Intersect"
     EndIf
     Sync
  Until EscKey()
  





 
Related Info: CirclesIntersect | LineIntersectCircle | LinesIntersect | PointInBox :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com