2018-08-03 18:20:38 +01:00
|
|
|
/**
|
|
|
|
* Haversine distance tests.
|
|
|
|
*
|
|
|
|
* @author Dachande663 [dachande663@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2018
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
2019-07-09 12:23:59 +01:00
|
|
|
import TestRegister from "../../lib/TestRegister.mjs";
|
2018-08-03 18:20:38 +01:00
|
|
|
|
|
|
|
TestRegister.addTests([
|
|
|
|
{
|
|
|
|
name: "Haversine distance",
|
|
|
|
input: "51.487263,-0.124323, 38.9517,-77.1467",
|
2020-12-09 21:12:26 +11:00
|
|
|
expectedOutput: "5902542.836307819",
|
2020-12-08 21:17:43 +11:00
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
"op": "Haversine distance",
|
|
|
|
"args": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Haversine distance, zero distance",
|
|
|
|
input: "51.487263,-0.124323, 51.487263,-0.124323",
|
|
|
|
expectedOutput: "0",
|
2018-08-03 18:20:38 +01:00
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
"op": "Haversine distance",
|
|
|
|
"args": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
}
|
|
|
|
]);
|