field depth




JavaScript Source Code 3000: Calculators: Field Depth Calculator








































Field Depth Calculator







For all you photography enthusiasts out there, this script makes it a breeze to determine the field depth and amount that will be in focus in a photograph. Includes other measurements such as nearest and furthest points of focus, too.









Depth of Field Calculator




Negative Format



35 mm
APS
6x45 cm
6x6 cm
6x7 cm
5x4 inch
10x8 inch





Lens focal length



17 mm
20 mm
24 mm
28 mm
35 mm
50 mm
70 mm
80 mm
100 mm
135 mm
150 mm
200 mm
210 mm
300 mm
350 mm
400 mm





Selected aperture



F 1.4
F 1.8
F 2
F 2.8
F 4
F 5.6
F 8
F 11
F 16
F 22
F 32
F 45
F 64
F 90





Subject distance (Meters)










 Hyperfocal distance for this lens/aperture combination.

 Near limit of acceptable sharpness.

 Far limit of acceptable sharpness.

 Total depth of field.











JavaScript Source Code 3000: Calculators: Field Depth Calculator
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!





    





<!-- TWO STEPS TO INSTALL FIELD DEPTH CALCULATOR:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: alistair@silverlight.co.uk -->
<!-- Web Site: http://www.silverlight.co.uk -->

<! >
<! >

<!-- Begin
// alistair@silverlight.co.uk
// http://www.silverlight.co.uk
function doField(form) {
distance = (form.distance.value)*1000;
CoC = (document.form.format.options[document.form.format.selectedIndex].value);
aperture = (document.form.aperture.options[document.form.aperture.selectedIndex].value);
focal = (document.form.focal.options[document.form.focal.selectedIndex].value);
if (isNaN(distance)) {
alert('Please enter a numerical value for subject distance.');
document.form.distance.focus();
document.form.distance.select();
}
else {
hyperFocal = (focal * focal) / (aperture * CoC);
form.hyperFocal.value = Math.round(hyperFocal) / 1000 + " m";
dofNear = (hyperFocal * distance) / (hyperFocal + (distance - focal));
form.dofNear.value = Math.round(dofNear) / 1000 + " m";
dofFar = (hyperFocal * distance) / (hyperFocal - (distance - focal));
if (dofFar < 0) {
form.dofFar.value = "Infinity.";
}
else {
form.dofFar.value = Math.round(dofFar)/1000+" m";
}
dofTotal = Math.round(dofFar - dofNear);
if (dofTotal < 0) {
form.dofTotal.value = "Infinite.";
}
else {
if (dofTotal >= 0 && dofTotal < 0.001) {
form.dofTotal.value = ">1 mm ";
}
else {
form.dofTotal.value = dofTotal / 1000 + " m";
}
}
}
}
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>
<form method=post name=form>
<table border=3 cellpadding=10 cellspacing=0 width=500>
<tr>
<td align=center colspan=2>
Depth of Field Calculator
</td>
</tr>
<tr>
<td align=left>
Negative Format
</td>
<td align=left>
<select name=format>
<option value=0.033>35 mm
<option value=0.025>APS
<option value=0.05>6x45 cm
<option value=0.06>6x6 cm
<option value=0.065>6x7 cm
<option value=0.15>5x4 inch
<option value=0.3>10x8 inch
</select>
</td>
</tr>
<tr>
<td align=left>
Lens focal length
</td>
<td align=left>
<select name=focal>
<option value=17>17 mm
<option value=20>20 mm
<option value=24>24 mm
<option value=28>28 mm
<option value=35>35 mm
<option value=50>50 mm
<option value=70>70 mm
<option value=80>80 mm
<option value=100>100 mm
<option value=135>135 mm
<option value=150>150 mm
<option value=200>200 mm
<option value=210>210 mm
<option value=300>300 mm
<option value=350>350 mm
<option value=400>400 mm
</select>
</td>
</tr>
<tr>
<td align=left>
Selected aperture
</td>
<td align=left>
<select name=aperture>
<option value=1.4>F 1.4
<option value=1.8>F 1.8
<option value=2>F 2
<option value=2.8>F 2.8
<option value=4>F 4
<option value=5.6>F 5.6
<option value=8> F 8
<option value=11>F 11
<option value=16>F 16
<option value=22>F 22
<option value=32>F 32
<option value=45>F 45
<option value=64>F 64
<option value=90>F 90
</select>
</td>
</tr>
<tr>
<td align=left>
Subject distance (Meters)
</td>
<td align=left>
<input type=text name=distance value="" size=6>
</td>
</tr>
<tr>
<td colspan=2 align=left>
<br>
<center><input type=button value="Calculate." onclick="doField(this.form)"></center>
<p>
<input name=hyperFocal type=text value="" size=6> Hyperfocal distance for this lens/aperture combination.
<BR>
<input name=dofNear type=text value="" size=6> Near limit of acceptable sharpness.
<BR>
<input name=dofFar type=text value="" size=6> Far limit of acceptable sharpness.
<BR>
<input name=dofTotal type=text value="" size=6> Total depth of field.
<BR>
<br>
</td></tr>
</table>
</form>
</table>
</center>



<!-- Script Size: 4.00 KB -->











Wyszukiwarka