mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-04-19 08:21:22 +08:00
20 lines
479 B
TypeScript
20 lines
479 B
TypeScript
import { LocationType } from "../../interfaces/Interfaces";
|
|
import GetDistance from "./GetDistance";
|
|
|
|
export default function GetDistanceFromUSTP(location: LocationType) {
|
|
const ustpCoords = {
|
|
latitude: 8.4857,
|
|
longitude: 124.6565,
|
|
latitudeDelta: 0.000235,
|
|
longitudeDelta: 0.000067,
|
|
};
|
|
|
|
let dist = GetDistance(
|
|
location.latitude,
|
|
location.longitude,
|
|
ustpCoords.latitude,
|
|
ustpCoords.longitude
|
|
);
|
|
dist = Math.round(dist);
|
|
return dist;
|
|
}
|