style: apply prettier formatting to wiki files and wiki-sync workflow

This commit is contained in:
Aric Camarata 2026-03-08 16:51:28 -04:00
parent f6f22f87e1
commit 200f661944
3 changed files with 53 additions and 41 deletions

View file

@ -3,7 +3,7 @@ name: Sync Wiki
on: on:
push: push:
branches: [main] branches: [main]
paths: ['.wiki/**'] paths: [".wiki/**"]
permissions: permissions:
contents: write contents: write

View file

@ -17,7 +17,7 @@ where φ₁, λ₁ is the observer and φ₂, λ₂ is the Ka'bah.
**Parameters:** **Parameters:**
| Name | Type | Description | | Name | Type | Description |
| ----- | -------- | ------------------------------------------ | | ----- | -------- | ---------------------------------------------------------------- |
| `lat` | `number` | Observer latitude in decimal degrees. Valid range: 90 to 90. | | `lat` | `number` | Observer latitude in decimal degrees. Valid range: 90 to 90. |
| `lng` | `number` | Observer longitude in decimal degrees. Valid range: 180 to 180. | | `lng` | `number` | Observer longitude in decimal degrees. Valid range: 180 to 180. |
@ -26,7 +26,7 @@ where φ₁, λ₁ is the observer and φ₂, λ₂ is the Ka'bah.
**Throws:** `RangeError` if either coordinate is out of bounds. **Throws:** `RangeError` if either coordinate is out of bounds.
```typescript ```typescript
import { qiblaAngle } from '@acamarata/qibla'; import { qiblaAngle } from "@acamarata/qibla";
qiblaAngle(40.7128, -74.006); // ~58.48 (New York → Mecca) qiblaAngle(40.7128, -74.006); // ~58.48 (New York → Mecca)
qiblaAngle(51.5074, -0.1278); // ~119.0 (London → Mecca) qiblaAngle(51.5074, -0.1278); // ~119.0 (London → Mecca)
@ -44,13 +44,13 @@ Maps the bearing to one of eight 45° sectors, selecting the nearest cardinal or
**Parameters:** **Parameters:**
| Name | Type | Description | | Name | Type | Description |
| --------- | -------- | ---------------------------- | | --------- | -------- | --------------------------- |
| `bearing` | `number` | Bearing in degrees (0360). | | `bearing` | `number` | Bearing in degrees (0360). |
**Returns:** `CompassAbbr` — One of: `N`, `NE`, `E`, `SE`, `S`, `SW`, `W`, `NW`. **Returns:** `CompassAbbr` — One of: `N`, `NE`, `E`, `SE`, `S`, `SW`, `W`, `NW`.
```typescript ```typescript
import { compassDir } from '@acamarata/qibla'; import { compassDir } from "@acamarata/qibla";
compassDir(0); // "N" compassDir(0); // "N"
compassDir(45); // "NE" compassDir(45); // "NE"
@ -67,13 +67,13 @@ Returns the full compass direction name for a bearing.
**Parameters:** **Parameters:**
| Name | Type | Description | | Name | Type | Description |
| --------- | -------- | ---------------------------- | | --------- | -------- | --------------------------- |
| `bearing` | `number` | Bearing in degrees (0360). | | `bearing` | `number` | Bearing in degrees (0360). |
**Returns:** `CompassName` — One of: `North`, `Northeast`, `East`, `Southeast`, `South`, `Southwest`, `West`, `Northwest`. **Returns:** `CompassName` — One of: `North`, `Northeast`, `East`, `Southeast`, `South`, `Southwest`, `West`, `Northwest`.
```typescript ```typescript
import { compassName } from '@acamarata/qibla'; import { compassName } from "@acamarata/qibla";
compassName(58.5); // "Northeast" compassName(58.5); // "Northeast"
``` ```
@ -89,7 +89,7 @@ Useful for drawing the Qibla direction line on a map. Returns `steps + 1` points
**Parameters:** **Parameters:**
| Name | Type | Default | Description | | Name | Type | Default | Description |
| ------- | -------- | ------- | ------------------------------------------------ | | ------- | -------- | ------- | ---------------------------------------------------- |
| `lat` | `number` | — | Observer latitude in decimal degrees (90 to 90). | | `lat` | `number` | — | Observer latitude in decimal degrees (90 to 90). |
| `lng` | `number` | — | Observer longitude in decimal degrees (180 to 180). | | `lng` | `number` | — | Observer longitude in decimal degrees (180 to 180). |
| `steps` | `number` | `120` | Number of segments. Result has `steps + 1` points. | | `steps` | `number` | `120` | Number of segments. Result has `steps + 1` points. |
@ -101,7 +101,7 @@ Useful for drawing the Qibla direction line on a map. Returns `steps + 1` points
Special case: if the observer is at the Ka'bah (distance = 0), returns `[[lat, lng]]`. Special case: if the observer is at the Ka'bah (distance = 0), returns `[[lat, lng]]`.
```typescript ```typescript
import { qiblaGreatCircle } from '@acamarata/qibla'; import { qiblaGreatCircle } from "@acamarata/qibla";
const path = qiblaGreatCircle(40.7128, -74.006); // 121 points const path = qiblaGreatCircle(40.7128, -74.006); // 121 points
// path[0] ≈ [40.7128, -74.006] (New York) // path[0] ≈ [40.7128, -74.006] (New York)
@ -119,7 +119,7 @@ Uses the haversine formula with a spherical Earth (R = 6,371 km, WGS-84 volumetr
**Parameters:** **Parameters:**
| Name | Type | Description | | Name | Type | Description |
| ------ | -------- | ------------------------------------- | | ------ | -------- | ------------------------------------------ |
| `lat1` | `number` | First point latitude in decimal degrees. | | `lat1` | `number` | First point latitude in decimal degrees. |
| `lng1` | `number` | First point longitude in decimal degrees. | | `lng1` | `number` | First point longitude in decimal degrees. |
| `lat2` | `number` | Second point latitude in decimal degrees. | | `lat2` | `number` | Second point latitude in decimal degrees. |
@ -128,7 +128,7 @@ Uses the haversine formula with a spherical Earth (R = 6,371 km, WGS-84 volumetr
**Returns:** `number` — Distance in kilometers. **Returns:** `number` — Distance in kilometers.
```typescript ```typescript
import { distanceKm, KAABA_LAT, KAABA_LNG } from '@acamarata/qibla'; import { distanceKm, KAABA_LAT, KAABA_LNG } from "@acamarata/qibla";
distanceKm(40.7128, -74.006, KAABA_LAT, KAABA_LNG); // ~9,634 km distanceKm(40.7128, -74.006, KAABA_LAT, KAABA_LNG); // ~9,634 km
``` ```
@ -138,13 +138,13 @@ distanceKm(40.7128, -74.006, KAABA_LAT, KAABA_LNG); // ~9,634 km
## Constants ## Constants
| Constant | Value | Description | | Constant | Value | Description |
| ----------------- | ----------- | --------------------------------------------------- | | ----------------- | ----------- | ------------------------------------------------ |
| `KAABA_LAT` | `21.422511` | Ka'bah center latitude in decimal degrees north. | | `KAABA_LAT` | `21.422511` | Ka'bah center latitude in decimal degrees north. |
| `KAABA_LNG` | `39.82615` | Ka'bah center longitude in decimal degrees east. | | `KAABA_LNG` | `39.82615` | Ka'bah center longitude in decimal degrees east. |
| `EARTH_RADIUS_KM` | `6371` | WGS-84 volumetric mean radius in kilometers. | | `EARTH_RADIUS_KM` | `6371` | WGS-84 volumetric mean radius in kilometers. |
```typescript ```typescript
import { KAABA_LAT, KAABA_LNG, EARTH_RADIUS_KM } from '@acamarata/qibla'; import { KAABA_LAT, KAABA_LNG, EARTH_RADIUS_KM } from "@acamarata/qibla";
``` ```
--- ---
@ -154,15 +154,21 @@ import { KAABA_LAT, KAABA_LNG, EARTH_RADIUS_KM } from '@acamarata/qibla';
### `CompassAbbr` ### `CompassAbbr`
```typescript ```typescript
type CompassAbbr = 'N' | 'NE' | 'E' | 'SE' | 'S' | 'SW' | 'W' | 'NW'; type CompassAbbr = "N" | "NE" | "E" | "SE" | "S" | "SW" | "W" | "NW";
``` ```
### `CompassName` ### `CompassName`
```typescript ```typescript
type CompassName = type CompassName =
| 'North' | 'Northeast' | 'East' | 'Southeast' | "North"
| 'South' | 'Southwest' | 'West' | 'Northwest'; | "Northeast"
| "East"
| "Southeast"
| "South"
| "Southwest"
| "West"
| "Northwest";
``` ```
--- ---

View file

@ -24,7 +24,13 @@ npm install @acamarata/qibla
``` ```
```typescript ```typescript
import { qiblaAngle, compassDir, distanceKm, KAABA_LAT, KAABA_LNG } from '@acamarata/qibla'; import {
qiblaAngle,
compassDir,
distanceKm,
KAABA_LAT,
KAABA_LNG,
} from "@acamarata/qibla";
const bearing = qiblaAngle(40.7128, -74.006); // New York const bearing = qiblaAngle(40.7128, -74.006); // New York
console.log(bearing); // ~58.48 console.log(bearing); // ~58.48