本文へ移動

Hoshi Stars星

肉眼で見える星の名前・色・距離、88星座の線と境界、メシエ天体、そしてそれらを描くための7種類の図法を使えます。

「星」(ほし) は、夜空に光って見えるものです。 名前について(英語)

目次

リファレンス · 星・天体・位置の近くにあるもの (空と宇宙で)、隣り合う星座

nearest関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The things nearest a star, a deep-sky object or a point, nearest first. By angle (by: "sky", the default) it measures the angle on the sky with the form atan2(|a x b|, a . b) of unit vectors, which keeps its accuracy at 0 and at 180 degrees and across right ascension 0 and 360. By space (by: "space") it places each star from its parallax and finds the straight-line distance, in light-years and in parsecs; it needs a target with a distance and leaves out every candidate without one, counting them in skipped. The target itself is never in its own answer.

By default the three-dimensional answers cover only the bright stars: the 2,533 of the 5,080 Yale stars that have a positive parallax, so the neighbours are bright stars, not the nearest ones. Their parallaxes are whole milliarcseconds, so a distance is good to a few per cent for a star within 100 light-years and not at all for a faint, far one; error is undefined for them. To include the stars of /nearby (Proxima Centauri, Barnard's Star, the red dwarfs, with a parallax error each) pass among: [...stars(), ...nearbyStars()]; error is then worked out for a nearby star from a target that is a point or a nearby star.

Every candidate is looked at (no index); one query over all the stars takes about a millisecond.

インポート

import { nearest } from "@johnmorrisdotca/hoshi-stars/nearest";

定義

function nearest(target: NearestTarget, options: SkyOptions & { kind: "deep-sky"; among?: undefined; }): NearestList<NearestInSky<DeepSkyObject>>
function nearest<T extends NearestThing>(target: NearestTarget, options: SkyOptions & { kind?: "star" | "deep-sky"; among: readonly T[]; }): NearestList<NearestInSky<T>>
function nearest(target: NearestTarget, options?: SkyOptions & { kind?: "star"; among?: undefined; }): NearestList<NearestInSky>
function nearest<T extends NearestThing>(target: NearestTarget, options: NearestOptions & { by: "space"; among: readonly T[]; }): NearestList<NearestInSpace<Extract<T, Star | NearbyStar>>>
function nearest(target: NearestTarget, options: NearestOptions & { by: "space"; }): NearestList<NearestInSpace>
function nearest(target: NearestTarget, options: NearestOptions): NearestList<NearestInSky<NearestThing> | NearestInSpace<Star | NearbyStar>>

引数

名前型説明
targetNearestTarget

A star, a deep-sky object, a name ("Mizar", "M31") or { rightAscension, declination } in degrees (with lightYears for a query by space).

optionsNearestOptions

count (default 10), within (degrees by sky, light-years by space), kind ("star" or "deep-sky"), by, date, magnitude (the faintest to include) and among.

戻り値

NearestList<NearestInSky<NearestThing> | NearestInSpace<Star | NearbyStar>>

A new list of { thing, angle } or { thing, distance, parsecs, error } with a skipped count.

例

import { nearest } from "@johnmorrisdotca/hoshi-stars/nearest";

const near = nearest("Mizar", { count: 1 });
console.log(near[0]?.thing.name, near[0]?.angle.toFixed(2)); // Alcor 0.20
const close = nearest("Sirius", { by: "space", count: 1 });
console.log(close[0]?.thing.designation, close[0]?.distance.toFixed(1)); //
undefined 0.00
α CMi 5.1

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/hoshi-stars 0.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。