Hi, I hope you can help, it's a long time since school and I find my self with a practical problem where I need to isolate a variable in a formula. The formula is
S = ((DH/(H-D+F))-((DH/(H+D-F))
Is it possible to derive a formula or solve for D i.e isolate D given I have the values of all the other variables?
Many thanks for your help, this will help me a great deal
Multiply both sides by (D+ H- F)(D- H+ F) to get rid of the fraction
Note that D- H+ F= D- (H+ F) so that (D+ H- F)(D- H+ F) is a :"product of sum and difference"- so we have
Subtract from both sides to get
That's a quadratic equation and you can solve for D using the quadratic formula:
with , , and .
(If S= 2, you cannot use that formula because you cannot divide by 0, then this is not a quadratic at all but is FHD- 2(H- F)= 0 which has solution
To explain what I'm trying to do: I'm trying to manipulate the formula used in photography to calculate the depth of field (DoF) within a photograph i.e the amount of image in acceptable focus. This is dependent on a few things, your camera's sensor, the focal length and aperature of your lens and the distance you are from the subject. It is a common formula that it used widely but I have only ever seen it to calculate the DoF which I have called S. I was trying to solve it for the distance required D, so I can work out exactly how far away I need to be for a certain amount of the image to be in focus without the trial and error involved using the more traditional formula. So, after a bit of basic formula engineering I got it to the point within my original post but got stuck trying to solve it for S (Sharp focus). F is the focal length of the lens and H is the hyperfocal point - the distance that maximises the DoF. So hopefully you can see this is a practical problem that would help me out greatly.
As a practical example to work backwards to get D, i use
D = 1000
F = 50
H = 44759.2311
Which gives S = 42.468478, this is in millimetres so 4.246 cm should be in focus if my subject is 100cm away using a 50mm lens. But say I know that I want about 4cm to be in focus so what distance do I need to be at? hence solving it for D? Plugging the other known values back into the solved formula I hope to get D = 1000 but it doesn't seem to be there just yet?
Once again many thanks for your help
Did you trip up here HallsofIvy?Note that D- H+ F= D- (H+ F) so that (D+ H- F)(D- H+ F) is a :"product of sum and difference"-
The original was (h-d+f)(h+d-f)
for which I had
From there I have...
This reduces down to
and the best I could get for d was
Huge thank you for this. Just to prove how clueless I am with this, if I substitute the values in and solve for d using + and - I get 2 values as is the nature of the formula I suppose. The aim is to get one formula for d that will give a single answer, is this possible?
Not really since the square root part is positive
if the square root of this is less than
then there are 2 solutions
if it is greater than then you can disregard the -ve root
hope this helps
btw, I know nothing about photography. If any of your other variables can have a negative value, let me know which
None of the original variables will be negative. Using the values I gave as an example, the square is more than f(h+s) so ignoring the minus then I make d=50.03369 which is spookly close to f but I was expecting d to equal 1000?