mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-24 00:36:16 -04:00
Added Haversine distance operation
This operation calculates the great circle distance between two GPS co-ordinates, returning the value
This commit is contained in:
parent
4ca14ed0ce
commit
87b77215e4
4 changed files with 82 additions and 0 deletions
|
@ -44,6 +44,7 @@ import "./tests/operations/ConditionalJump";
|
|||
import "./tests/operations/Register";
|
||||
import "./tests/operations/Comment";
|
||||
import "./tests/operations/Hash";
|
||||
import "./tests/operations/HaversineDistance";
|
||||
import "./tests/operations/Hexdump";
|
||||
import "./tests/operations/Image";
|
||||
import "./tests/operations/MorseCode";
|
||||
|
|
22
test/tests/operations/HaversineDistance.mjs
Normal file
22
test/tests/operations/HaversineDistance.mjs
Normal file
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Haversine distance tests.
|
||||
*
|
||||
* @author Dachande663 [dachande663@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../TestRegister";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Haversine distance",
|
||||
input: "51.487263,-0.124323, 38.9517,-77.1467",
|
||||
expectedOutput: "5619355.701829259",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Haversine distance",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue