Skip to the content

Chikyu Earth地球

A line-drawn globe of the world's countries that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place.

Chikyu is the Japanese word 地球 for the Earth. About the name

Contents

Reference · Printable sheets: the globe and a world map to colour, my country, day and night, the seasons

hatchPathfunction

Parallel lines, spacing apart at angleDeg, cut to where inside(x, y) is true, as the data of one SVG path (a millimetre of the picture is a millimetre of the paper). Each end is found to a twentieth of a millimetre.

Import it

import { hatchPath } from "@johnmorrisdotca/chikyu-earth/sheets";

Definition

function hatchPath(bounds: Bounds, spacing: number, angleDeg: number, inside: (x: number, y: number) => boolean): string

Parameters

NameTypeDescription
boundsBounds

The box the lines are laid over.

spacingnumber

The gap between lines, in millimetres.

angleDegnumber

The turn of the lines, in degrees from the x axis.

inside(x: number, y: number) => boolean

Whether a point is in the shaded part.

Returns

string

Path data: M x y L x y for each stroke.

Examples

import { hatchPath } from "@johnmorrisdotca/chikyu-earth/sheets";

const d = hatchPath({ x0: 0, y0: 0, x1: 20, y1: 20 }, 4, 45, (x) => x < 10);
console.log(d.startsWith("M"));
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chikyu-earth 0.51.1.