An F# library that given a latitude and logitude record will return the direction of the Kaaba, also known as the Qibla. The algorithm is based on The Correct Qibla by S. Kamal Abdali.
dotnet add package QiblaDirection
or from Visual Studios package manager console
Install-Package QiblaDirection -ProjectName YOUR_PROJECT_NAME
open QiblaDirection
(*
Case: Ok,
trueNorth: Degrees 118.93071604419522
*)
GetQiblaDirectionHandler.qiblaDirectionQueryHandler' { lat = 51.522079; lon = -0.191380 }
open QiblaDirection
(* Output:
Case: Error
[
{
message: "Please provide a latitude value between -90 to 90"
invalidField: "latitude"
},
{
message: "Please provide a longitude value between -180 to 180"
invalidField: "longitude"
}
]
*)
GetQiblaDirectionHandler.qiblaDirectionQueryHandler'{ lat = 90.0012; lon = 180.0121 }