Reference · Framing, geometry and quiz tools
circleMeetsRingfunction
Whether a circle of this radius at this point touches the land inside a ring.
Import it
import { circleMeetsRing } from "@johnmorrisdotca/chizu";
Definition
function circleMeetsRing(x: number, y: number, radius: number, ring: MapRing): boolean
Parameters
| Name | Type | Description |
|---|---|---|
x | number | The horizontal native map coordinate. |
y | number | The vertical native map coordinate. |
radius | number | The circle or label radius in native map units. |
ring | MapRing | A closed outline ring in native map units. |
Returns
boolean
Whether a circle of this radius at this point touches the land inside a ring.
Examples
import { circleMeetsRing, parseMapRings } from "@johnmorrisdotca/chizu";
const [square] = parseMapRings("M0,0L10,0L10,10L0,10Z");
console.log(circleMeetsRing(13, 5, 2, square!), circleMeetsRing(13, 5, 4, square!));
// false truefalse trueWhat it prints (run when this page was built)