跳到主要内容

utils.circlesIntersect()

The utils.circlesIntersect() function finds the inter分区 between two circles described by their center point and radius.

Signature

array | false utils.circlesIntersect(
Point centerA,
float radiusA,
Point centerB,
float radiusB,
string sort = 'x'
)

The 5th and last parameter controls the sorting of the found inter分区. When this returns 2 inter分区, you can choose how they are ordered in the returned array:

Set sort to:

  • x : The point with the lowest X-coordinate will go first (left to right)
  • y : The point with the lowest Y-coordinate will go first (top to bottom)

Example

A Utils.circlesIntersect() example