Switch squaredEuclideanDistance to uint64_t
This commit is contained in:
		
							parent
							
								
									fa6d4ac0bc
								
							
						
					
					
						commit
						68ee4eab61
					
				| @ -34,7 +34,7 @@ const constexpr double MAX_LONGITUDE = 180.0; | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| //! Takes the squared euclidean distance of the input coordinates. Does not return meters!
 | //! Takes the squared euclidean distance of the input coordinates. Does not return meters!
 | ||||||
| double squaredEuclideanDistance(const FloatCoordinate &lhs, const FloatCoordinate &rhs); | std::uint64_t squaredEuclideanDistance(const Coordinate &lhs, const Coordinate &rhs); | ||||||
| 
 | 
 | ||||||
| double haversineDistance(const Coordinate first_coordinate, const Coordinate second_coordinate); | double haversineDistance(const Coordinate first_coordinate, const Coordinate second_coordinate); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -18,10 +18,10 @@ namespace coordinate_calculation | |||||||
| { | { | ||||||
| 
 | 
 | ||||||
| // Does not project the coordinates!
 | // Does not project the coordinates!
 | ||||||
| double squaredEuclideanDistance(const FloatCoordinate &lhs, const FloatCoordinate &rhs) | std::uint64_t squaredEuclideanDistance(const Coordinate &lhs, const Coordinate &rhs) | ||||||
| { | { | ||||||
|     const double dx = static_cast<double>(lhs.lon - rhs.lon); |     const std::uint64_t dx = static_cast<std::int32_t>(lhs.lon - rhs.lon); | ||||||
|     const double dy = static_cast<double>(lhs.lat - rhs.lat); |     const std::uint64_t dy = static_cast<std::int32_t>(lhs.lat - rhs.lat); | ||||||
| 
 | 
 | ||||||
|     return dx * dx + dy * dy; |     return dx * dx + dy * dy; | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user