How calculate distance of tow points (between my location and previously my location) in ionic?

Hi developers , i am using ionic and geolocalisation but i want to calculate the distance between my previously location and new location

I want help, please ?

This is definitely not an Ionic Question and Questions like these are answered like 1000times in the Web. After one Second of Googling i found for example this: