package ipp.imse.fusionOptics.imse;

import fusionOptics.Util;
import fusionOptics.interfaces.Absorber;
import fusionOptics.interfaces.Reflector;
import fusionOptics.lenses.Nikon135mmF28;
import fusionOptics.lenses.Nikon50mmF11;
import fusionOptics.lenses.SchneiderXenon25mmF095;
import fusionOptics.surfaces.Iris;
import fusionOptics.surfaces.Square;
import fusionOptics.types.Surface;
import jafama.FastMath;

/** Silly experiment using a ring mirror to deflect off the unusded light and image it for a
 * second diagnostic, e.g. the spectral MSE.
 * 
 * @author oliford
 *
 */
public class IMSEOptics75_25_silly_second_diag extends IMSEOptics {
	public Surface fibres2;

	public IMSEOptics75_25_silly_second_diag() {
	
		focalLength1 = 0.075;
		
		focalLength2 = 0.025;

		rotateObjLens = true;
		
		imgLensPlaneToCell = 0.035; //for the 25mm

		objLensPlaneToCell = rotateObjLens ? 0.110 : 0.080; //for the 75 (50 scaled)
		
		objLens = new Nikon50mmF11(new double[]{ focalLength1 + focusAdjustObj, 0, 0 }, 0.075/0.050);
		objLensCaseRadius = ((Nikon50mmF11)objLens).getCaseRadius();
		
		imgLens = new SchneiderXenon25mmF095(new double[]{ imgLensPos(), 0, 0 });
		imgLensCaseRadius = ((SchneiderXenon25mmF095)imgLens).getCaseRadius();
		
		double rt2o2 = FastMath.sqrt(2) / 2;
		addElement(new Iris("sillyRefl", new double[]{ focalLength1 + objLensPlaneToCell - 0.025, 0, 0 }, new double[]{ -rt2o2, rt2o2, 0 }, 0.035, 0.020, Reflector.ideal()));
		
		Nikon50mmF11 lens3 = new Nikon50mmF11(new double[]{ focalLength1 + objLensPlaneToCell - 0.025, 0.080, 0 }, 0.050/0.050);
		Util.rotateOnZ(lens3, lens3.getBoundarySphereCentre(), Math.PI/2);
		
		addElement(lens3);
		
		fibres2 = new Square("fibres2", new double[]{ focalLength1 + objLensPlaneToCell - 0.025, 0.080 + 0.050, 0}, 
				new double[]{ 0, 1, 0 }, new double[]{ 0, 0, 1 }, 0.050, 0.050, null, null, Absorber.ideal());
		addElement(fibres2);
		
				
		init();
		
		
	}
}
