Reference · The realistic Earth's pure parts
discRadiusfunction
The disc's radius in CSS pixels in a box of width x height at zoom: it fits the glow in the box at 1x.
Import it
import { discRadius } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
function discRadius(width: number, height: number, zoom: number): number
Parameters
| Name | Type | Description |
|---|---|---|
width | number | The box's width in CSS pixels. |
height | number | The box's height in CSS pixels. |
zoom | number | The view's zoom, 1 at Fit. |
Returns
number
The radius in CSS pixels, at least 1.
Examples
import { discRadius } from "@johnmorrisdotca/chikyu-earth/realistic";
console.log(discRadius(400, 400, 1).toFixed(1));184.2What it prints (run when this page was built)