mirror of
https://github.com/acamarata/moon-sighting.git
synced 2026-06-30 19:04:24 +00:00
Add typedoc and typedoc-plugin-markdown as devDependencies. Add typedoc.json config targeting src/index.ts with markdown output to .github/wiki/api. Add docs script to package.json. Generate initial API reference pages. Part of T-E8-03 — TypeDoc automation for all 12 JS/TS packages.
56 lines
1.2 KiB
Markdown
56 lines
1.2 KiB
Markdown
[**moon-sighting v1.1.1**](../README.md)
|
|
|
|
***
|
|
|
|
[moon-sighting](../README.md) / getMoonPosition
|
|
|
|
# Function: getMoonPosition()
|
|
|
|
> **getMoonPosition**(`date?`, `lat`, `lon`, `elevation?`): [`MoonPosition`](../interfaces/MoonPosition.md)
|
|
|
|
Defined in: [api/index.ts:539](https://github.com/acamarata/moon-sighting/blob/89fb490051d0263a7d41c954161fb945f1569805/src/api/index.ts#L539)
|
|
|
|
Compute the Moon's topocentric position (azimuth, altitude, distance) for an observer.
|
|
|
|
Works WITHOUT a kernel (uses Meeus Ch. 47 approximation).
|
|
Accuracy: azimuth/altitude ~0.3°, distance ~300 km.
|
|
For precision crescent work, use getMoonSightingReport() with the DE442S kernel.
|
|
|
|
## Parameters
|
|
|
|
### date?
|
|
|
|
`Date` = `...`
|
|
|
|
Date and time to compute position for (default: now)
|
|
|
|
### lat
|
|
|
|
`number`
|
|
|
|
Observer geodetic latitude in degrees (north positive)
|
|
|
|
### lon
|
|
|
|
`number`
|
|
|
|
Observer longitude in degrees (east positive)
|
|
|
|
### elevation?
|
|
|
|
`number` = `0`
|
|
|
|
Observer height above WGS84 ellipsoid in meters (default: 0)
|
|
|
|
## Returns
|
|
|
|
[`MoonPosition`](../interfaces/MoonPosition.md)
|
|
|
|
Topocentric az/alt (degrees), distance (km), parallactic angle (radians)
|
|
|
|
## Example
|
|
|
|
```ts
|
|
const pos = getMoonPosition(new Date(), 51.5, -0.1)
|
|
console.log(pos.azimuth, pos.altitude) // e.g. 212.4, 38.1
|
|
```
|