discRadius関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { discRadius } from "@johnmorrisdotca/chikyu-earth/realistic";
定義
function discRadius(width: number, height: number, zoom: number): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
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. |
戻り値
number
The radius in CSS pixels, at least 1.
例
import { discRadius } from "@johnmorrisdotca/chikyu-earth/realistic";
console.log(discRadius(400, 400, 1).toFixed(1));184.2出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。