mirror of
https://github.com/acamarata/qibla.git
synced 2026-06-30 19:04:28 +00:00
chore: align repository structure with portfolio documentation standards
This commit is contained in:
parent
be0513f89f
commit
2fcf3d3201
6 changed files with 42 additions and 28 deletions
0
.wiki/Home.md → .github/wiki/Home.md
vendored
0
.wiki/Home.md → .github/wiki/Home.md
vendored
4
.github/workflows/wiki-sync.yml
vendored
4
.github/workflows/wiki-sync.yml
vendored
|
|
@ -3,7 +3,7 @@ name: Sync Wiki
|
|||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: [".wiki/**"]
|
||||
paths: [".github/wiki/**"]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
|
|
@ -29,7 +29,7 @@ jobs:
|
|||
- name: Sync wiki pages
|
||||
if: steps.clone_wiki.outputs.wiki_exists == 'true'
|
||||
run: |
|
||||
cp .wiki/*.md .wiki-remote/
|
||||
cp .github/wiki/*.md .wiki-remote/
|
||||
cd .wiki-remote
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
|
|
|||
36
src/index.ts
36
src/index.ts
|
|
@ -10,14 +10,17 @@
|
|||
* @module
|
||||
*/
|
||||
|
||||
/** Latitude of the Ka'bah center, Masjid al-Haram, Mecca (degrees north). */
|
||||
export const KAABA_LAT = 21.422511;
|
||||
export * from "./types.js";
|
||||
|
||||
/** Longitude of the Ka'bah center, Masjid al-Haram, Mecca (degrees east). */
|
||||
export const KAABA_LNG = 39.82615;
|
||||
|
||||
/** Mean radius of the Earth in kilometers (WGS-84 volumetric mean). */
|
||||
export const EARTH_RADIUS_KM = 6371;
|
||||
import {
|
||||
KAABA_LAT,
|
||||
KAABA_LNG,
|
||||
EARTH_RADIUS_KM,
|
||||
COMPASS_ABBR,
|
||||
COMPASS_NAMES,
|
||||
type CompassAbbr,
|
||||
type CompassName,
|
||||
} from "./types.js";
|
||||
|
||||
const DEG = Math.PI / 180;
|
||||
|
||||
|
|
@ -50,26 +53,7 @@ export function qiblaAngle(lat: number, lng: number): number {
|
|||
return (Math.atan2(y, x) / DEG + 360) % 360;
|
||||
}
|
||||
|
||||
/** Eight-point compass abbreviations. */
|
||||
const COMPASS_ABBR = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] as const;
|
||||
|
||||
/** Eight-point compass full names. */
|
||||
const COMPASS_NAMES = [
|
||||
"North",
|
||||
"Northeast",
|
||||
"East",
|
||||
"Southeast",
|
||||
"South",
|
||||
"Southwest",
|
||||
"West",
|
||||
"Northwest",
|
||||
] as const;
|
||||
|
||||
/** Compass abbreviation type. */
|
||||
export type CompassAbbr = (typeof COMPASS_ABBR)[number];
|
||||
|
||||
/** Compass full name type. */
|
||||
export type CompassName = (typeof COMPASS_NAMES)[number];
|
||||
|
||||
/**
|
||||
* Eight-point compass abbreviation for a bearing.
|
||||
|
|
|
|||
30
src/types.ts
Normal file
30
src/types.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/** Latitude of the Ka'bah center, Masjid al-Haram, Mecca (degrees north). */
|
||||
export const KAABA_LAT = 21.422511;
|
||||
|
||||
/** Longitude of the Ka'bah center, Masjid al-Haram, Mecca (degrees east). */
|
||||
export const KAABA_LNG = 39.82615;
|
||||
|
||||
/** Mean radius of the Earth in kilometers (WGS-84 volumetric mean). */
|
||||
export const EARTH_RADIUS_KM = 6371;
|
||||
|
||||
/** Eight-point compass abbreviations. */
|
||||
export const COMPASS_ABBR = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] as const;
|
||||
|
||||
/** Eight-point compass full names. */
|
||||
export const COMPASS_NAMES = [
|
||||
"North",
|
||||
"Northeast",
|
||||
"East",
|
||||
"Southeast",
|
||||
"South",
|
||||
"Southwest",
|
||||
"West",
|
||||
"Northwest",
|
||||
] as const;
|
||||
|
||||
/** Compass abbreviation type. */
|
||||
export type CompassAbbr = (typeof COMPASS_ABBR)[number];
|
||||
|
||||
/** Compass full name type. */
|
||||
export type CompassName = (typeof COMPASS_NAMES)[number];
|
||||
|
||||
Loading…
Reference in a new issue