html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<title>Pythagorean Theorem for distance calculation</title>
</head>
<body>
<p>
A Cartesian plane is defined by two perpendicular number lines: the x-axis, which is horizontal, and the y-axis, which is vertical.
Using these axes, we can describe any point in the plane using an ordered pair of numbers.
Here is
a program which takes two different points, A(x1,y1) and B(x2,y2), and returns the distance between these two points.
The distance formula is the Pythagorean Theorem. </p>
<input type="number" id="x1" size="3" placeholder="A(x1)"/>
<input type="number" id="y1" placeholder="A(y1)"/>
<input type="number" id="x2" name="x2" placeholder="B(x2)"/>
<input type="number" id="y2"name="y2" placeholder="B(y2)"/>
<br/>
<button type="button" onclick="ab_func()" name="abfunc" value="Result">Result</button>
<br/>
<input type="text" name="AB" id="AB" readonly="readonly"/>
<script>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run