%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Single lens matrix
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear; clc;

% Inputs
n = 1.0; % index of left
nL= 1.6; % index of lens
np= 1.0; % index of right
R1= 45;  % radius of first surface
R2= 30;  % radius of second surface
t = 5;   % center thickness of lens

% matrices
M3 = [1 0; (nL-np)/(np*R2) nL/np];
M2 = [1 t; 0 1];
M1 = [1 0; (n-nL)/(nL*R1)  n/nL];

% Lens matrix
M = M3*M2*M1
D = det(M)

% effective focal length of the lens
EFFL = -1/M(2,1)
