Skip to content

Commit

Permalink
fix panic issue if addition of 2 y coordinates is too big for FastCos
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferix9288 committed Jun 27, 2019
1 parent 065780e commit 3a89fc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion distance.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func FastSine(x float64) float64 {
// FastCos calculates cosinus from sinus
func FastCos(x float64) float64 {
x += math.Pi / 2.0
if x > math.Pi {
for x > math.Pi {
x -= 2 * math.Pi
}

Expand Down

0 comments on commit 3a89fc2

Please sign in to comment.