This content originally appeared on DEV Community and was authored by Mauro Peluso
Well, being an optician like myself, those who are also in the field will know about the changes that sometimes need to be made to the dioptres in ophthalmic prescriptions. As simple as it may seem, it would be useful to have a #Python function to perform this quickly. Here's my solution.
esf = -1.50
cil = -0.50
eje = 90
if eje >= 90:
eje -= 90
else:
eje += 90
esfinv = esf+cil
if cil > 0:
cil = -cil
else:
cil = abs(cil)
print(f"esferico {esfinv} x cilindrico {cil} en {eje}°")
In this example the results are: *esferico -2.0 x cilindrico 0.5 en 0°*
Thank you in advance for viewing this post. If you have any feedback, whether positive or negative, I look forward to reading it. Namaste.
This content originally appeared on DEV Community and was authored by Mauro Peluso
Mauro Peluso | Sciencx (2024-10-18T03:04:39+00:00) Optical Investment Calculator. Retrieved from https://www.scien.cx/2024/10/18/optical-investment-calculator/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.