リファレンス · 距離で見る空 (10・50・100・500・1,000光年より近い星や銀河を層に分けて、距離の帯ごとに色分けします。距離がはっきりしないものは別にし、推測で置くことはしません)
stepLimit関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The next limit up or down the steps (10, 50, 100, 500, 1,000, then all). From all a step down is 1,000; from 10 a step down stays at 10; a limit between two steps goes to the nearer step in that direction.
インポート
import { stepLimit } from "@johnmorrisdotca/hoshi-stars/distance";
定義
function stepLimit(limit: number, direction: 1 | -1): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
limit | number | The limit now, in light-years ( |
direction | 1 | -1 | 1 for farther, -1 for nearer. |
戻り値
number
The new limit.
例
import { stepLimit } from "@johnmorrisdotca/hoshi-stars/distance";
console.log(stepLimit(10, 1), stepLimit(1000, 1), stepLimit(Infinity, -1), stepLimit(70, 1), stepLimit(70, -1));50 Infinity 1000 100 50出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。