Edit and compile if you like:
\documentclass[border=2pt]{standalone}% Drawing\usepackage{tikz}\tikzset{>=latex}\usetikzlibrary{decorations.markings, calc}% New Command%% Middle Line Label\newcommand{\midlabelline}[3]{\node (midlabel) at ($ (#1)!.5!(#2) $) {#3};\draw[<-] (#1) -- (midlabel);\draw[->] (midlabel) -- (#2);}%% Point\newcommand{\point}[3]{\draw[fill=black] (#1) circle (1pt) node[#3] {#2};}% Styles%% Arrow in the Middle\tikzset{arrow inside/.style = {postaction=decorate,decoration={markings,mark=at position 0.52 with \arrow{stealth}}}}% Define Color\definecolor{glass}{cmyk}{0.2,0,0,0}\begin{document}\begin{tikzpicture}[scale=1.5]% Grid% \draw[help lines] (-3,-3) grid (6,6);% Lens\path[fill=glass, draw=black, line width = 0.6] (1,-2) .. controls (0.8,0) .. (1,2) .. controls (1.2,0) .. (1,-2);% Axis\draw[dashed, black!60] (1,-1.9) -- (1,1.9);\draw[dashed, black!60] (-2.5,0) -- (3.5,0);% Ray
Click to download: lens.tex
Open in Overleaf: lens.tex
This file is available on GitHub.
See more on the author page of Alexandros Tsagkaropolulos.