Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
Dinstance -> Distance
  • Loading branch information
sgbasaraner committed May 7, 2020
1 parent 2c47dc3 commit 409ffd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions HaversineDistance/HaversineDistance.playground/Contents.swift
@@ -1,6 +1,6 @@
import UIKit

func haversineDinstance(la1: Double, lo1: Double, la2: Double, lo2: Double, radius: Double = 6367444.7) -> Double {
func haversineDistance(la1: Double, lo1: Double, la2: Double, lo2: Double, radius: Double = 6367444.7) -> Double {

let haversin = { (angle: Double) -> Double in
return (1 - cos(angle))/2
Expand All @@ -27,4 +27,4 @@ let amsterdam = (52.3702, 4.8952)
let newYork = (40.7128, -74.0059)

// Google says it's 5857 km so our result is only off by 2km which could be due to all kinds of things, not sure how google calculates the distance or which latitude and longitude google uses to calculate the distance.
haversineDinstance(la1: amsterdam.0, lo1: amsterdam.1, la2: newYork.0, lo2: newYork.1)
haversineDistance(la1: amsterdam.0, lo1: amsterdam.1, la2: newYork.0, lo2: newYork.1)

0 comments on commit 409ffd6

Please sign in to comment.