remove unneeded non null assertion

This commit is contained in:
Abhinav 2024-01-23 20:03:19 +05:30
parent 883bea8baa
commit 142f485a4a

View file

@ -65,10 +65,10 @@ function isLocationCloseToPoint(
location: Location,
radius: number
) {
const a = (radius * _scaleFactor(centerPoint.latitude!)) / KMS_PER_DEGREE;
const a = (radius * _scaleFactor(centerPoint.latitude)) / KMS_PER_DEGREE;
const b = radius / KMS_PER_DEGREE;
const x = centerPoint.latitude! - location.latitude!;
const y = centerPoint.longitude! - location.longitude!;
const x = centerPoint.latitude - location.latitude;
const y = centerPoint.longitude - location.longitude;
if ((x * x) / (a * a) + (y * y) / (b * b) <= 1) {
return true;
}