whichpiece[theta_]:=If[(Pi/2<theta<3Pi/2),-1,1]

Manipulate[
Show[
ParametricPlot[
{Cos[t],Sin[t]},{t,0,2 Pi},ImageSize->300,Ticks->{{-1,1,2,3,4,5,6},{-1,1}},PlotRange->{{-Pi/2,2 Pi},{-4,4}},AspectRatio->8/(2 Pi+Pi/2)
],
Graphics[
{
Opacity[1],
Blue,
Line[{{0,0},{1,Tan[theta]}}],
Red,
Line[{{1,0},{1,Tan[theta]}}],
Green,
Line[{{theta,0},{theta,Tan[theta]}}]
}
],
Plot[
Tan[t],{t,-Pi/2,2 Pi}
]
],
{{theta,0},-Pi/2,2 Pi},SaveDefinitions->True
]