discCoverfunction
A mask for a round body, such as the Earth seen from space: every spot within radius pixels of its centre is covered.
Import it
import { discCover } from "@johnmorrisdotca/hoshi-stars/sky-labels";
Definition
function discCover(x: number, y: number, radius: number): CoverMask
Parameters
| Name | Type | Description |
|---|---|---|
x | number | The centre's x in pixels. |
y | number | The centre's y in pixels. |
radius | number | The radius in pixels. |
Returns
CoverMask
A mask for StarNames.update.
Examples
import { discCover } from "@johnmorrisdotca/hoshi-stars/sky-labels";
const earth = discCover(400, 700, 300);
console.log(earth(400, 500), earth(400, 300));true falseWhat it prints (run when this page was built)