TITLE: Cardioid in coffee mug?
QUESTION [102 upvotes]: I've been learning about polar curves in my Calc class and the other day I saw this suspiciously $r=1-\cos \theta$  looking thing in my coffee cup (well actually $r=1-\sin \theta$ if we're being pedantic.) Some research revealed that it's called a caustic. I started working out why it would be like this, but hit a snag. Here's what I did so far:
Consider the polar curves $r=1-\cos \theta$ and $r=1$. Since for a light ray being reflected off a surface (or the inside of my cup) the $\angle$ of incidence =$\angle$ of reflection, a point on the circle $(1,\theta)\to(1,2\theta)$. It looks like this has something to do with the tangent lines, so I pretend there's an $xy$ plane centered at the pole to find the slope of the line connecting the points. Since it's the unit circle the corresponding rectangular coordinates are $(\cos \theta, \sin \theta)$ and $(\cos 2\theta, \sin 2\theta).$ So 
$$m={\sin 2\theta-\sin \theta \over \cos 2\theta-\cos \theta}$$
now we see if it matches up with the slope of the lines tangent to the cardioid
$$\frac{dy}{dx}={r'\sin \theta+r \cos \theta \over r' \cos \theta - r \sin \theta}={\sin^2\theta - \cos^2 \theta +\cos \theta \over 2\sin \theta \cos \theta -\sin\theta}={\cos \theta - \cos 2\theta\over \sin 2\theta-\sin \theta}$$
They're similar, but not identical. In particular $\frac{dy}{dx}=-\frac1m$. What error have I made, or what have I overlooked conceptually? Thanks in advance.

REPLY [39 votes]: Light From Infinity
Most likely, the light is from a distance that is large on the scale of the cup. Therefore, we will take the incoming rays to be parallel. If so, the caustic in the coffee cup is a nephroid.
Consider the following diagram

The ray reflected at the point $(-\cos(\theta),\sin(\theta))$ is
$$
\frac{y-\sin(\theta)}{x+\cos(\theta)}=-\tan(2\theta)\tag{1}
$$
which is
$$
x\sin(2\theta)+y\cos(2\theta)=-\sin(\theta)\tag{2}
$$
Here is a plot of the reflected rays from $(2)$ generated by uniformly distributed parallel incoming rays

Taking the derivative of $(2)$ with respect to $\theta$:
$$
2x\cos(2\theta)-2y\sin(2\theta)=-\cos(\theta)\tag{3}
$$
Solving $(2)$ and $(3)$ simultaneously gives the envelope of the family of lines in $(1)$:
$$
\begin{align}
\begin{bmatrix}
x\\
y
\end{bmatrix}
&=
\begin{bmatrix}
\cos(2\theta)&-\sin(2\theta)\\
\sin(2\theta)&\cos(2\theta)
\end{bmatrix}^{-1}
\begin{bmatrix}
-\frac12\cos(\theta)\\
-\sin(\theta)
\end{bmatrix}\\[6pt]
&=\frac14\begin{bmatrix}
\cos(3\theta)-3\cos(\theta)\\
3\sin(\theta)-\sin(3\theta)
\end{bmatrix}\tag{4}
\end{align}
$$
The curve from $(4)$ is added in red

Equation $(4)$ describes a nephroid.

Light From A Point On The Circle
Since it is mentioned in a comment that a cardoid is formed by light coming from a point on the edge of the cup, we will do the same computation with light from a point on the circle.
Consider the following diagram

The ray reflected at the point $(-\cos(\theta),\sin(\theta))$ is
$$
\frac{y-\sin(\theta)}{x+\cos(\theta)}=-\tan\left(\frac{3\theta}2\right)\tag{5}
$$
which is
$$
y(1+\cos(3\theta))+x\sin(3\theta)=\sin(\theta)-\sin(2\theta)\tag{6}
$$
Here is a plot of the reflected rays from $(6)$ reflected at uniformly spaced points on the circle

Taking the derivative of $(6)$ with respect to $\theta$:
$$
-3y(\sin(3\theta))+3x\cos(3\theta)=\cos(\theta)-2\cos(2\theta)\tag{7}
$$
Solving $(6)$ and $(7)$ simultaneously gives the envelope of the family of lines in $(5)$:
$$
\begin{align}
\begin{bmatrix}
x\\
y
\end{bmatrix}
&=
\begin{bmatrix}
\cos(3\theta)&-\sin(3\theta)\\
\sin(3\theta)&1+\cos(3\theta)
\end{bmatrix}^{-1}
\begin{bmatrix}
\frac13\cos(\theta)-\frac23\cos(2\theta)\\
\sin(\theta)-\sin(2\theta)
\end{bmatrix}\\[6pt]
&=\frac13\begin{bmatrix}
\cos(2\theta)-2\cos(\theta)\\
2\sin(\theta)-\sin(2\theta)
\end{bmatrix}\tag{8}
\end{align}
$$
The curve from $(8)$ is added in red

Equation $(8)$ describes a cardoid.