Code Monkey home page Code Monkey logo

find-nearest-hospital-bd's Introduction

Find The Nearest Hospital in BD

  • Request by your current location latitude & longitude
  • get hospital name, contact number as response

Calculation

Using Haversine Formula to find the nearest point (e.g. city) based on latitude and longitude.

hav(θ) = sin2(θ2).

Law of Haversine:

To derive law of Haversine one needs to start the calculation with spherical law of cosine i.e cos a = cos b * cos c + sin b * sin c * cos A One can derive Haversine formula to calculate distance between two as:

a = sin²(ΔlatDifference/2) + cos(lat1).cos(lt2).sin²(ΔlonDifference/2)
c = 2.atan2(√a, √(1−a))
d = R.c

where,

ΔlatDifference = lat1 – lat2 (difference of latitude)

ΔlonDifference = lon1 – lon2 (difference of longitude)

R is radius of earth i.e 6371 KM or 3961 miles

and d is the distance computed between two points.

API Endpoint

https://find-nearest-hospital-bd.herokuapp.com/main/v1/loc?lat=23.7869245&lng=90.3774381

API Response

{
  "data": {
    "lat": 23.7763428,
    "lon": 90.3696447,
    "name": "National Institute Of Neurosciences & Hospital",
    "phone": "01726920703"
  },
  "status": "success",
  "timestamp": 1638945588.7289119
}

find-nearest-hospital-bd's People

Contributors

imamhossain94 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.