README
qibla-ts
A Typescript helper class to provide you the qibla direction relative to True North based on provided coordinates
Installation
$ npm install qibla-ts
Usage
Import the Qibla class. Use the static function call to calcuate the degrees from True North for the provided coordinates {lat, long}
.
import { Qibla } from 'qibla-ts';
// Mumbai: 280
let qiblaFromTrueNorth = Qibla.degreesFromTrueNorth(19.0826881, 72.6009796);
What angle is the Qibla from True North?
The qibla angle returned represents the angle shown in a typical smartphone compass. i.e. North = 0 deg, East = 90 deg, South = 180 deg, and West = 270 deg
It should be noted that the actual angle as shown in a physical (non digital, non smartphone) magnetic compass would be different as it shows with reference to the Magnetic North. Smartphone compasses do not have such a problem as they compensate automatically and show the angles with reference to the True North.
Contributing
To build and run the tests you would need to have Node.js/NPM installed and run the below commands.
$ npm install
$ npm test