/* -*-ePiX-*- */ #include "epix.h" using namespace ePiX; void mirror(const P& loc, const P& refl, double thk = 0.25, double wd = 6) { double my(pt_to_screen(wd)), mx(pt_to_screen(thk)); P dir(refl - loc); dir *= 1.0/(norm(dir)); P perp(J(dir)), p1(loc + mx*dir - my*perp), p2(loc + mx*dir + my*perp), p3(loc - mx*dir + my*perp), p4(loc - mx*dir - my*perp); quad(p1, p2, p3, p4); } void scope(const P& vwr, const P& pt) { double mx(pt_to_screen(8)), my(pt_to_screen(2)); P dir(pt - vwr); dir *= 1.0/(norm(dir)); P perp(J(dir)), p1(pt - 2*mx*dir + my*perp), p2(pt - 2*mx*dir - my*perp), p3(pt - my*perp), p4(pt + my*perp); quad(p1, p2, p3, p4); ellipse(pt, 0.2*my*dir, my*perp); ellipse(pt - 2*mx*dir, 0.2*my*dir, my*perp); // viewer's eye double th(40); P eye(pt - 3*mx*dir); line(eye, eye + polar(3*my, -th)); line(eye, eye + polar(3*my, th)); arc_measure(eye, cis(-th), cis(th), 4); arc_measure(eye, cis(-10), cis(10), 4.25); } int main() { picture(P(-1,-1), P(1,1), "2 x 2in"); begin(); P O(0, 0), pA(E_1), pAp(E_2); degrees(); line(O, pA); line(O, pAp); dashed(); dash_size(6); line(O, -pA); line(O, -pAp); solid(); fill(Black()); mirror(pA, O); mirror(pAp, O); fill(White()); mirror(P(0,0), P(-1,1), 1, 12); masklabel(-pAp, "*"); label(-pAp, P(4, 0), "\\textit{Source of Light.}", r); scope(-pA - E_1, -pA); label(-pA, P(0, -12), "\\textit{Observer.}", b); label(pA, P(2, 0), "$A$", r); label(pAp, P(0, 2), "$A'$", t); label(0.5*pA, P(0, -4), "$l$", b); label(0.5*pAp, P(2, 0), "$l'$", r); label(P(0.5*(xmin() + xmax()), ymin()), P(0, -24), "\\textsc{Fig.~9.}", b); tikz_format(); end(); }