Skip to the content

Chizu地図

Draw SVG maps, frame regions, place numbered callouts and build geography quizzes with English and Japanese names.

Chizu is the Japanese word 地図 for map. About the name

Contents

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

NameTypeDescription
xnumber

The horizontal native map coordinate.

ynumber

The vertical native map coordinate.

radiusnumber

The circle or label radius in native map units.

ringMapRing

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 true
false true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chizu 1.5.0.