positionIn3Dfunction
The place in space of a direction and a distance: right ascension and declination in degrees, distance in light-years, on the J2000 equatorial axes with the viewpoint at the origin.
Import it
import { positionIn3D } from "@johnmorrisdotca/hoshi-stars/constellation-3d";
Definition
function positionIn3D(rightAscension: number, declination: number, lightYears: number): Point3
Parameters
| Name | Type | Description |
|---|---|---|
rightAscension | number | Degrees. |
declination | number | Degrees, -90 to 90. |
lightYears | number | The distance. |
Returns
Point3
[x, y, z] in light-years.
Examples
import { positionIn3D } from "@johnmorrisdotca/hoshi-stars/constellation-3d";
console.log(positionIn3D(90, 0, 10)); // about [0, 10, 0][ 6.123233995736766e-16, 10, 0 ]What it prints (run when this page was built)