mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
merge: add description (#843)
This commit is contained in:
@ -1,10 +1,12 @@
|
|||||||
/*
|
/**
|
||||||
Calculate the distance between two coordinates using the haversine formula
|
* @function HaversineDistance
|
||||||
More about: https://pt.wikipedia.org/wiki/F%C3%B3rmula_de_Haversine
|
* @description Calculate the distance between two coordinates using the haversine formula
|
||||||
@Param {number} latitude1
|
* @param {Integer} latitude1 - The input integer
|
||||||
@Param {number} latitude2
|
* @param {Integer} latitude2 - The input integer
|
||||||
@Param {number} longitude1
|
* @param {Integer} longitude1 - The input integer
|
||||||
@Param {number} longitude2
|
* @param {Integer} longitude2 - The input integer
|
||||||
|
* @return {Integer} Haversine Distance.
|
||||||
|
* @see [Haversine_Distance](https://pt.wikipedia.org/wiki/F%C3%B3rmula_de_Haversine)
|
||||||
*/
|
*/
|
||||||
const haversineDistance = (latitude1 = 0, longitude1 = 0, latitude2 = 0, longitude2 = 0) => {
|
const haversineDistance = (latitude1 = 0, longitude1 = 0, latitude2 = 0, longitude2 = 0) => {
|
||||||
validateLatOrLong(latitude1)
|
validateLatOrLong(latitude1)
|
||||||
|
Reference in New Issue
Block a user