qibla/.github/wiki/api/functions/qiblaAngle.md
Aric Camarata a59756bd07 docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0)
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.
2026-05-30 16:41:58 -04:00

1 KiB

@acamarata/qibla v1.1.1


@acamarata/qibla / qiblaAngle

Function: qiblaAngle()

qiblaAngle(lat, lng): number

Defined in: index.ts:46

Qibla bearing in degrees clockwise from true north.

Uses the forward azimuth formula from spherical trigonometry. Result range: [0, 360).

Parameters

lat

number

Observer latitude in decimal degrees (-90 to 90).

lng

number

Observer longitude in decimal degrees (-180 to 180).

Returns

number

Bearing in degrees clockwise from north (0 = N, 90 = E, 180 = S, 270 = W).

Throws

If latitude is outside [-90, 90] or longitude outside [-180, 180].

Example

qiblaAngle(40.7128, -74.006);  // ~58.49 (New York)
qiblaAngle(51.5074, -0.1278);  // ~119.0 (London)

See

https://github.com/acamarata/qibla/wiki/api/qiblaAngle Wiki API page