-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
95 lines (83 loc) · 3.41 KB
/
index.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<html>
<head>
<script>
</script>
</head>
<body>
<form>
<div>
all units in inches or degrees
Foobar!
</div>
<div>
<label for="nominalHeight">nominal height</label>
<input type="text" name="nominalHeight" id="nominalHeight" value="96"/>
</div>
<div>
<label for="floorDiameter">floor diameter</label>
<input type="text" name="floorDiameter" id="floorDiameter"/>
</div>
<div>
<label for="memberThickness">member thickness</label>
<input type="text" name="memberThickness" id="memberThickness"/>
</div>
<div>
<label for="memberLength">member length</label>
<input type="text" name="memberLength" id="memberLength"/>
</div>
<div>
<label for="memberAngle">member angle</label>
<input type="text" name="memberAngle" id="memberAngle"/>
</div>
<div>
<button type="button" onclick="recalculate();">recalculate</button>
</div>
<div id="calculatedDims">
<div>
<label for="actualHeight">actual height</label>
<input type="text" name="actualHeight" id="actualHeight" readonly/>
</div>
<div>
<label for="numberOfVerticalSlices">number Of Vertical Slices</label>
<input type="text" name="numberOfVerticalSlices" id="numberOfVerticalSlices" readonly/>
</div>
<div>
<label for="sphereRadius">sphere radius</label>
<input type="text" name="sphereRadius" id="sphereRadius" readonly/>
</div>
</div>
<div id="cutSheet">
</div>
</form>
</body>
<script>
//user defined parameters
let nominalHeight;
let floorDiameter;
let memberThickness;
let memberLength;
let memberAngle;
//calculated parameters
let actualHeight;
let halfActualHeight;
let numberOfVerticalSlices;
let sphereRadius;
function recalculate(){
nominalHeight = document.getElementById('nominalHeight').value;
floorDiameter = document.getElementById('floorDiameter').value;
memberThickness = document.getElementById('memberThickness').value;
memberLength = document.getElementById('memberLength').value;
memberAngle = document.getElementById('memberAngle').value;
if(nominalHeight && floorDiameter && memberThickness && memberLength && memberAngle ){
actualHeight = nominalHeight - ( nominalHeight % memberThickness );
halfActualHeight = ( actualHeight / memberThickness ) * 1;
numberOfVerticalSlices = ( actualHeight / memberThickness ) * 1;
sphereRadius = 'implement';
document.getElementById('actualHeight').value = actualHeight;
document.getElementById('numberOfVerticalSlices').value = numberOfVerticalSlices;
document.getElementById('sphereRadius').value = sphereRadius;
}
}
recalculate();
</script>
</html>