Exercise 03: Distance

Date completed: 05/06/2018

Write function distance that calculates the distance between two points (x1, y1) and (x2, y2). All numbers and return values should be floating-point values. Incorporate this function into a script that enables the user to enter the coordinates of the points through an HTML5 form.

Solution

To begin, fill in the form below.

PointValuePointValue
x1 y1
x2 y2