Lillie is writing a program that calculates geometry formulas. Her procedure ca1cDistance should return the distance between two points, based on the Pythagorean distance formula:
d=√(x₂)-x₁)²+(y₂-y₁)²
This is the code of the procedure with line numbers:
1.PROCEDURE calcDistance (x1,y1,x2,y2)
2. {
3. xDiff * 2-* 1
4. yDiff -y2-y1
5. sum P DW(xDiff,2)+POw(yDiff,2)
6. distance SQRT(sum)
7.}
The procedure relies on two provided functions, POW which returns a number raised to an exponent, and SQRT which returns the square root of a number.