Skip to content

Commit

Permalink
made sure the arcCos si always computed for a value between -1 and 1
Browse files Browse the repository at this point in the history
  • Loading branch information
cdelaunay committed Feb 28, 2022
1 parent 22dabc4 commit 774a4b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OGC-Spheric/OGCSphericSystem.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ OGCSphericSystem class >> distanceFromPoint: pointA toPoint: pointB [
sinValue := (latA sin ) * (latB sin).
cosValue := (latA cos ) * (latB cos) * ((lonA - lonB) cos).

^ ray * ((sinValue + cosValue) arcCos)
^ ray * (((sinValue + cosValue) max: -1.0) min: 1.0) arcCos
]

0 comments on commit 774a4b3

Please sign in to comment.