Point_in_circle - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

Description

Checks if the given point is inside the given circle and returns the result.

Parameters

Parameter Data Type Description
px double x coordinate of the point
py double y coordinate of the point
cx double x coordinate of the circle center
cy double y coordinate of the circle center
rad double radius of the circle

Return Values

boolean: Returns whether the point lies inside the circle.

Example Call

// demonstrates checking if the mouse is hovering over an object
if (point_in_circle(mouse_x, mouse_y, x, y, radius)) {
  // mouse is within 50 pixels of the calling instance
}

NOTOC

Category:Function:Real