Circle Math module
- Source:
Requires
- module:interactables.js
Methods
(static) isCircleInsideCircle(circle1, circle2) → {boolean}
This function calculates the distance between the centers of the two circles and compares it
to the radii of both circles to determine if one circle is fully inside the other.
Parameters:
| Name | Type | Description |
|---|---|---|
circle1 |
HTMLElement | The first circle element to check. |
circle2 |
HTMLElement | The second circle element to check. |
- Source:
Returns:
Returns true if either the first circle is completely inside the second circle or vice versa, otherwise false.
- Type
- boolean
(inner) getCircleCenter(circleElement) → {Object}
This function calculates the center and radius of the circle element, taking into account
specific conditions for certain interactable elements, such as patches and needles.
If the element is a "big patch" or a "star patch," it adjusts the radius accordingly.
Parameters:
| Name | Type | Description |
|---|---|---|
circleElement |
HTMLElement | An html element that will be calculated as a circle based on its position and width. |
- Source:
Returns:
An object containing the center coordinates (centerX, centerY)
and radius (radius) of the circle.
- Type
- Object