Post Reply 
(17Bii) - my first "program"; a Depth of Field calculator for the 17Bii
12-08-2019, 10:37 PM
Post: #3
RE: (17Bii) - my first "program"; a Depth of Field calculator for the 17Bii
(12-08-2019 06:50 PM)jthole Wrote:  This is my first serious equation for the 17Bii, so I welcome any suggestions for improvement!

First of all, the listing, using the well known formulas(*) for calculating the hyperfocal distance and depth of field:

DOFCALC:TDOF =
0 x L( DM : D x 1000 ) +
0 x L( HFD : FL ^ 2 ÷ ( APERT x COC ) ) +
0 x L( NP : ( ( HFD x G( DM ) ) ÷ ( HFD + ( G( DM ) - FL ) ) ) ÷ 1000 ) +
0 x L( FP : ( ( HFD x G( DM ) ) ÷ ( HFD - ( G( DM ) - FL ) ) ) ÷ 1000 ) +
0 x L( HFD : HFD ÷ 1000 ) +
IF( FP < 0 : 0 : FP - NP )


Where:

TDOF = the total DOF in meters, or 0 when the DoF is infinite.
D = the focus distance in meters. Internally the formulas use mm for distance and focal length.
FL = the focal length in mm.
APERT = the aperture value.
COC = the known CoC value for the medium (sensor or film.). For a digital APS-C sensor, I use CoC = 0.015

When computing the TDOF, you can RCL the NP (nearest point in focus) and FP (farthest point in focus), and the hyperfocal distance (HFD). When the DoF value is 0 (representing infinity), the farthest focus point is meaningless.

Caveat: I have tested this on the RLM tools 17Bii iPhone app, but it should work on the physical 17Bii calculator as well.

(I could have saved some parentheses, but left them in for clarity, because the formulas as explained in Wikipedia use them as well).

(*) there are two slightly different formulas for calculating the hyperfocal distance, but in practice the differences are too small to be meaningful, so I used the shortest one.

You could also do it this way (a little less verbose):

DOFCALC:TDOF =
0 x L( DM : D x 1000 ) X
L( HFD : FL ^ 2 ÷ ( APERT x COC ) ) X
L( NP : ( ( HFD x G( DM ) ) ÷ ( HFD + ( G( DM ) - FL ) ) ) ÷ 1000 ) X
L( FP : ( ( HFD x G( DM ) ) ÷ ( HFD - ( G( DM ) - FL ) ) ) ÷ 1000 ) X
L( HFD : HFD ÷ 1000 ) +
IF( FP < 0 : 0 : FP - NP )

Beautiful equation.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (17Bii) - my first "program"; a Depth of Field calculator for the 17Bii - Don Shepherd - 12-08-2019 10:37 PM



User(s) browsing this thread: 1 Guest(s)