Skip to content

Instantly share code, notes, and snippets.

@superboum
Last active July 3, 2022 08:53
Show Gist options
  • Save superboum/d19626bd529d9e2bf391d33e31ae846b to your computer and use it in GitHub Desktop.
Save superboum/d19626bd529d9e2bf391d33e31ae846b to your computer and use it in GitHub Desktop.
foc = 45 * pow(10, -3)
conf = 0.03 * pow(10, -3)
for ouv in [3.5, 4, 5.6, 8, 11, 16]:
hyper = (foc * foc) / (ouv * conf) + foc
ppn = (hyper * hyper) / (hyper + (hyper - foc))
print(f"{ouv} {round(hyper, 1)}m {round(ppn, 1)}m")
for ouv in [3.5, 4, 5.6, 8, 11, 16]:
hyper = (foc * foc) / (ouv * conf) + foc
for p in [1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4, 5, 7, 10, 20]:
dpn = (hyper * p) / (hyper - (p - foc))
ppn = (hyper * p) / (hyper + (p - foc))
pdc = dpn - ppn
if dpn < 0:
print(f"f/{ouv} p={p}m ppn={round(ppn,1)}m (pdc,dpn=infini)")
else:
print(f"f/{ouv} p={p}m pdc={round(pdc,1)}m ppn={round(ppn,1)}m dpn={round(dpn,1)}m")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment