What's new

HTLM code for calculate distance

Brecht B

New member

I want on my website a HTML code that calculate the distance from my place (still the same, can be filled in automaticaly) to a place the user choose.
These distance we need to multiply with 1 euro.
BUT: if the distance is 30 km or less, it is for free.
If the distance is more than 30 km, only the km above 30 we need to multiply with 1 euro.

Can somebody help me?

Thanks a lot.
Try this code:-
<h3>Find Distance Between Two Points</h3>
<p><h4>General Formula :</h4></p>
<img src="moomoomath.com/distanc png" width=200px alt="Image Not Available"/>
<p>Enter points x1,x2 and y1,y2</p>
<label>Point X1 :</label>
<input id="p1" type="number" placeholder="Enter x1">
<label>Point X2 :</label>
<input id="p2" type="number" placeholder="Enter x2">
<label>Point Y1 :</label>
<input id="p3" type="number" placeholder="Enter y1">
<label>Point Y2 :</label>
<input id="p4" type="number" placeholder="Enter y2">
<button onclick="calc();">DISTANCE :</button>
<div id="output"></div>

Hope it helps.

Apps4Rent | O365CloudExperts | CloudDesktopOnline