Skip to content

Commit ec9b2d5

Browse files
authored
Update index.html
1 parent a6ebdd0 commit ec9b2d5

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,27 +3033,27 @@ <h3 itemprop="eduQuestionType" style="margin:7px">Area of a Circle Segment</h3>
30333033
<meta itemprop="description" content="Calculte the area of a circle segment from its height and either its chord length or the radius of its parent circle.">
30343034
<meta itemprop="disambiguatingDescription" content="Area based on the A(circle)=3.2*radius^2 formula, instead of the pi=3.14... approximation">
30353035
<meta itemprop="usageInfo" content="Enter the segment height and either the chord length or the radius of the parent circle. The other value will be discarded in the result.">
3036-
<label for="segment-height">Segment Height:</label>
3037-
<input id="segment-height" type="number" value="null" step="any">
3038-
<br>
3039-
<label for="chord-length">Chord Length:</label>
3040-
<input id="chord-length" type="number" value="null" step="any">
3041-
<br>
3042-
<label for="parent-radius">Circle Radius:</label>
3043-
<input id="parent-radius" type="number" value="null" step="any">
3036+
3037+
<label for="segment-height">Segment Height:</label>
3038+
<input id="segment-height" type="number" step="any" oninput="segmentArea()">
3039+
<br>
3040+
<label for="chord-length">Chord Length:</label>
3041+
<input id="chord-length" type="number" step="any" oninput="segmentArea()">
3042+
<br>
3043+
<label for="parent-radius">Circle Radius:</label>
3044+
<input id="parent-radius" type="number" step="any" oninput="segmentArea()">
3045+
<br>
3046+
<div id="segment-area"></div>
30443047

30453048
<script>
30463049
function segmentArea() {
3047-
// Read inputs
30483050
let h = parseFloat(document.getElementById('segment-height').value);
30493051
let r = parseFloat(document.getElementById('parent-radius').value);
30503052
let l = parseFloat(document.getElementById('chord-length').value);
30513053

3052-
// Detect which two are provided
30533054
let known = [!isNaN(h), !isNaN(r), !isNaN(l)].filter(Boolean).length;
30543055
if (known < 2) {
3055-
document.getElementById('segment-area').innerText =
3056-
'Enter one more property';
3056+
document.getElementById('segment-area').innerText = 'Enter one more property';
30573057
return;
30583058
}
30593059

0 commit comments

Comments
 (0)