qibla-jsdeprecated

A JavaScript helper class to provide you the qibla direction relative to True North based on provided coordinates

Usage no npm install needed!

<script type="module">
  import qiblaJs from 'https://cdn.skypack.dev/qibla-js';
</script>

README

qibla-js

A JavaScript helper class to provide you the qibla direction relative to True North based on provided coordinates

Usage

Import the Qibla class. Use the function call to calcuate the degrees from True North for the provided coordinates {lat, long}.

let Qibla = require('qibla-js').Qibla;

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