Skip to content

Commit 8457e5f

Browse files
committed
add reset function
1 parent f25070e commit 8457e5f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

stereocalc.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,19 @@ const getWc = (Zc, theta) => 2 * Zc * theta;
5959
const getA = (Zc, theta, dN, Nc, W) => (2 * Zc * theta * dN * Nc) / (W * (Zc - Nc) + dN * Nc);
6060
const getCrop = (A, Wc) => A / (Wc + A);
6161
const getCpix = (Crop, X) => Crop * X;
62-
const getCout = (Cpix, X) => X - Cpix;
62+
const getCout = (Cpix, X) => X - Cpix;
63+
64+
// Reset input fields
65+
function resetCalculator() {
66+
getElement('viewingDistance').value = '700';
67+
getElement('nearDepthBudget').value = '68';
68+
getElement('farDepthBudget').value = '68';
69+
getElement('screenWidth').value = '340';
70+
getElement('screenWidthResolution').value = '1500'
71+
getElement('eyeSeparation').value = '65';
72+
getElement('nearestObject').value = '2000';
73+
getElement('furthestObject').value = '2400';
74+
getElement('focalLength').value = '80';
75+
getElement('sensorWidth').value = '36';
76+
calculate();
77+
}

0 commit comments

Comments
 (0)