Skip to content

Commit 9aa3608

Browse files
authored
Merge pull request kodecocodes#930 from sgbasaraner/patch-2
fix typo
2 parents 3a24cf9 + 409ffd6 commit 9aa3608

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: HaversineDistance/HaversineDistance.playground/Contents.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import UIKit
22

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

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

2929
// 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.
30-
haversineDinstance(la1: amsterdam.0, lo1: amsterdam.1, la2: newYork.0, lo2: newYork.1)
30+
haversineDistance(la1: amsterdam.0, lo1: amsterdam.1, la2: newYork.0, lo2: newYork.1)

0 commit comments

Comments
 (0)