In this section, we first give an expression for the ray-trace map, and secondly we derive a mathematical formulation for the location of the freeform surfaces using the laws of geometrical optics.
The mapping
\(\varvec{m}\) can be derived by tracing a typical ray through the optical system. Let us consider a ray emitted from a position
\(\texttt {x}\in \mathcal {S}\) on the source and propagating in the positive
z-direction, let
\({\hat{\varvec{s}}}\) be the unit direction of the incident ray. The ray strikes the first lens surface
\(\mathcal {L}_1\), refracts off in direction
\({\hat{\varvec{t}}}\), strikes the second lens surface
\(\mathcal {L}_2\), and reflects off, again in the direction
\({\hat{\varvec{s}}}\). The unit surface normal of the first lens surface
\(\mathcal {L}_1\), directed towards the light source, is given by
$$\begin{aligned} {\hat{\varvec{n}}}_1 = \frac{(\nabla u_1, -1)}{\sqrt{|\nabla u_1|^2 +1}}. \end{aligned}$$
(4)
Throughout this article, we use the convention that a hat denotes a unit vector. According to Snell’s law [
24,
25], the direction
\(\hat{\varvec{t}} = \hat{\varvec{t}}(\texttt {x})\) of the refracted ray can be expressed as
$$\begin{aligned} {\hat{\varvec{t}}} = \eta {\hat{\varvec{s}}} + F(|\nabla u_1|;\eta ){\hat{\varvec{n}}}_1, \end{aligned}$$
(5)
where
\(\eta = 1/n < 1 \) with
n the refractive index of the lens and
$$\begin{aligned} F(z;\eta ) = \frac{1}{\sqrt{z^2+1}}\Big [ \eta - \sqrt{1 + (1-\eta ^2)z^2}\Big ]. \end{aligned}$$
(6)
If we write
\({\hat{\varvec{t}}} = (t_1,t_2,t_3)^T\) then the first two components of the vector
\({\hat{\varvec{t}}}\), can be written as a function of the third component of the vector
\({\hat{\varvec{t}}}\) as
$$\begin{aligned} \begin{pmatrix} t_1 \\ t_2 \end{pmatrix} = (\eta -t_3) \nabla u_1. \end{aligned}$$
(7)
The image on the target of the point
\(\texttt {x}\in \mathcal {S}\) is the point
\(\texttt {y} \in \mathcal {T}\) under the ray trace mapping
\(\varvec{m}\), i.e.,
\(\texttt {y} = \varvec{m}(\texttt {x}), \texttt {x}\in \mathcal {S}\). This mapping can be obtained by the projection of
\({\hat{\varvec{t}}}\) on the plane
\(\alpha _1\), i.e.,
$$\begin{aligned} \varvec{m}(\texttt {x}) = \texttt {x} + \begin{pmatrix} t_1 \\ t_2 \end{pmatrix} d(\texttt {x}), \end{aligned}$$
(8)
where
\(d(\texttt {x})\) is the distance between surfaces
\(\mathcal {L}_1\) and
\(\mathcal {L}_2\) along the ray refracted in the direction
\({\hat{\varvec{t}}}(\texttt {x})\). The distance
\(d(\texttt {x})\) between the lens surfaces can be obtained using properties of geometrical optics: The total optical path length
\(L(\texttt {x})\) corresponding to the ray associated with a point
\(\texttt {x} \in \mathcal {S}\), is given by
$$\begin{aligned} L(\texttt {x}) = u_1(\texttt {x}) + nd(\texttt {x}) + u_2(\texttt {y}). \end{aligned}$$
(9)
The theorem of Malus and Dupin (the principle of equal optical path lengths) states that the total optical path length between any two orthogonal wavefronts is the same for all rays [
26, p. 130]. As we deal with two parallel beams of light rays, the wavefront coincides with planes
\(\alpha _1\) and
\(\alpha _2\). Therefore, the total optical path length will be independent of the position vector
\(\texttt {x}\), i.e.,
\(L(\texttt {x}) = L\). The horizontal distance
\(\ell \) between the source and the target plane is given by
$$\begin{aligned} \ell = u_1(\texttt {x}) + ({\hat{\varvec{s}}}\varvec{\cdot }{\hat{\varvec{t}}})d(\texttt {x}) + u_2(\texttt {y}). \end{aligned}$$
(10)
Subtracting Eqs. (
9) and (
10), and using Eq. (
5), we obtain the following expression
$$\begin{aligned} d(\texttt {x}) = \frac{\beta }{n-t_3}, \end{aligned}$$
(11)
where where
\(\beta = L-\ell \) is the “reduced” optical path length. Substituting (
7) and (
11) in (
8), we have
$$\begin{aligned} \varvec{m}(\texttt {x}) = \texttt {x} + \beta \frac{\eta -t_3}{n-t_3}. \end{aligned}$$
(12)
Now, substituting
\(t_3\) in the above equation from the law of refraction (
5), the mapping
\(\varvec{m}\) is given by the relation
$$\begin{aligned} \varvec{m}(\texttt {x}) = \texttt {x} - \frac{\beta \nabla u_1(\texttt {x})}{\sqrt{n^2 + (n^2 -1) |\nabla u_1|^2} } . \end{aligned}$$
(13)
Next, we derive a mathematical expressions for the location of the lens surfaces. An alternative expression for the distance
d reads
$$\begin{aligned} d^2 = \big ( \ell - u_1(\texttt {x}) - u_2(\texttt {y}) \big )^2 + |\texttt {x} - \texttt {y}|^2 . \end{aligned}$$
(14)
Thus, from Eqs. (
9) and (
14), we obtain
$$\begin{aligned} n^2 \big ( \ell - u_1(\texttt {x}) - u_2(\texttt {y}) \big )^2 + n^2 |\texttt {x} - \texttt {y}|^2 = \big (L - u_1(\texttt {x}) - u_2(\texttt {y})\big )^2 , \end{aligned}$$
which can be rewritten as
$$\begin{aligned} \bigg [u_1(\texttt {x}) + u_2(\texttt {y}) + \frac{L-n^2 \ell }{n^2-1} \bigg ]^2 + \frac{n^2}{n^2 -1} |\texttt {x} - \texttt {y}|^2 = \bigg ( \frac{n\beta }{n^2-1}\bigg )^2 , \end{aligned}$$
and after elementary algebraic derivations, we obtain
$$\begin{aligned} u_1(\texttt {x}) + u_2(\texttt {y}) = \frac{n^2 \ell -L}{n^2-1} \pm \frac{n}{n^2-1} \sqrt{\beta ^2 - (n^2-1) |\texttt {x} - \texttt {y}|^2 }. \end{aligned}$$
(15)
This is a mathematical expression for the location of the lens surfaces but the sign in front of the square root is unknown yet. To determine this we proceed as follows. Using Eqs. (
9) (with
\(L(\texttt {x}) = L\)) and (
14), we can show that
\(\beta ^2 - (n^2-1)|\texttt {x} - \texttt {y}|^2 = ( n\beta - d(n^2-1))^2 \ge 0\). Substituting, this expression in Eq. (
15), we obtain
$$\begin{aligned} u_1(\texttt {x}) + u_2(\texttt {y}) = \frac{n^2 \ell -L}{n^2-1} \pm \frac{n}{n^2-1}\big |n\beta - d(n^2-1)\big | . \end{aligned}$$
(16)
First, we check the sign of the expression
\( n\beta - d(n^2-1)\). Substituting
d from Eq. (
11), the expression becomes
$$\begin{aligned} n\beta - d(n^2-1) = \beta \frac{1-n t_3}{n-t_3}. \end{aligned}$$
Since
\(\beta >0\) and
\(n-t_3>0\), it remains to check the sign of
\(1-nt_3\). Using the vectorial form of the law of refraction (
5) and expression (
6), we can write
$$\begin{aligned} 1-nt_3 = \frac{1 - \sqrt{n^2 + (n^2- 1)|\nabla u_1|^2} }{|\nabla u_1|^2+1} < 0, \end{aligned}$$
(17)
as
\(n>1\). Thus we have to choose the negative sign in front of the absolute value in Eq. (
16). Hence, we obtain
$$\begin{aligned} u_1(\texttt {x}) + u_2(\texttt {x}) = \frac{n^2 \ell -L}{n^2-1} \pm \frac{nd(n^2-1)-n^2\beta }{n^2-1}. \end{aligned}$$
Substituting
d from relation (
9), the above expression becomes
$$\begin{aligned} u_1(\texttt {x}) + u_2(\texttt {y}) = \frac{n^2 \ell -L}{n^2-1}\pm \Big ( L- (u_1(\texttt {x}) + u_2(\texttt {y})) - \frac{n^2}{n^2-1} \beta \Big ). \end{aligned}$$
(18)
In the above equation, the right hand side equals the left hand side for the minus sign, therefore we have to choose minus sign in (
15). Thus the mathematical expression for the lens surfaces becomes
$$\begin{aligned} \begin{aligned} u_1(\texttt {x}) + u_2(\texttt {y})&= c(\texttt {x}, \texttt {y}),\\ c(\texttt {x}, \texttt {y})&= \ell - \frac{\beta }{n^2-1} - \frac{n}{n^2-1} \sqrt{\beta ^2 - (n^2-1) |\texttt {x} - \texttt {y}|^2 }. \end{aligned} \end{aligned}$$
(19)
These kind of freeform optical design problems are closely related to the mass transport problem [
10,
27]. The right hand side function
\(c(\texttt {x},\texttt {y})\) is known as the cost function in OMT theory.