## Distancia focal óptima

Hallar la raíz de la ecuación trascendente por el procedimiento del punto medio

$\begin{array}{l}\frac{h}{R-\sqrt{{R}^{2}-{h}^{2}}+f}\left(x-f\right)=\frac{-{h}_{\mathrm{max}}}{R-\sqrt{{R}^{2}-{h}_{\mathrm{max}}^{2}}+{f}_{\mathrm{min}}}\left(x-{f}_{\mathrm{min}}\right)\\ x=f+\left(\frac{\partial f}{\partial h}\right)\frac{f+R-\sqrt{{R}^{2}-{h}^{2}}}{f+R-\sqrt{{R}^{2}-{h}^{2}}-h\frac{\partial f}{\partial h}+\frac{h}{\sqrt{{R}^{2}-{h}^{2}}}}\\ f=\frac{n\sqrt{{R}^{2}-{n}^{2}{h}^{2}}-\left({n}^{2}-1\right)R+{n}^{2}\sqrt{{R}^{2}-{h}^{2}}}{{n}^{2}-1}\\ \frac{\partial f}{\partial h}=-\frac{{n}^{2}h}{{n}^{2}-1}\left(\frac{n}{\sqrt{{R}^{2}-{n}^{2}{h}^{2}}}+\frac{h}{\sqrt{{R}^{2}-{h}^{2}}}\right)\end{array}$

  public class Funcion extends Ecuacion{ double n; double R; double x; final double hMax=5.85; public Funcion(double n, double R){ this.n=n; this.R=R; } void setPos(double x){ this.x=x; } public double f(double h){ double x=caustica(h); return(recta(h, x)-recta(-hMax, x)); } double focal(double h){ double f=(n*Math.sqrt(R*R-n*n*h*h)-(n*n-1)*R+n*n*Math.sqrt(R*R-h*h))/(n*n-1); return f; } public double recta(double h, double x){ double y=-h*(x-focal(h))/(focal(h)+R-Math.sqrt(R*R-h*h)); return y; } private double dervFocal(double h){ double z=-(n*n*h/(n*n-1))*(n/Math.sqrt(R*R-n*n*h*h)+h/Math.sqrt(R*R-h*h)); return z; } public double caustica(double h){ double z=focal(h)+h*dervFocal(h)*(focal(h)+R-Math.sqrt(R*R-h*h))/(focal(h)+R-Math.sqrt(R*R-h*h)-h*dervFocal(h)-h*h/Math.sqrt(R*R-h*h)); return z; } } 

Distancia focal óptima

  Funcion lente=new Funcion(iRefraccion(lonOnda), radio); try{ double hRaiz=lente.puntoMedio(0.0, hMax); x0=lente.caustica(hRaiz); y0=lente.recta(hRaiz, x); }catch(RaizExcepcion ex){ System.out.println(ex.getMessage()); } //... double iRefraccion(int lonOnda){ double n=2.099-1.9446e-3*lonOnda+2.8756e-6*lonOnda*lonOnda-1.4745e-9*lonOnda*lonOnda*lonOnda; return n; }