Polar Grapher
Author: Marc Renault

Show polar grid

Show ray with angle θ

r = 3 + cos(8 \theta)

th = 0 (slider from 0 to 1, step 0.0010)
tmax = 12.56
fromtop: (y(Corner[4.0]) - y(Corner[1.0])) / 20.0
fromleft: (x(Corner[3.0]) - x(Corner[4.0])) / 25.0
tmin = 0
TH: th * (tmax - tmin) + tmin
f(x) = 3.0 + cos(8.0 x)
thetaRay = Ray((0.0, 0.0), (cos(TH), sin(TH)))
P: (f(TH) cos(TH), f(TH) sin(TH))
c = CurveCartesian(f(t) cos(t), f(t) sin(t), t, tmin, TH)
PolarLines: {Line[(0.0, 0.0), (0.8660254037844387, 0.49999999999999994)], Line[(0.0, 0.0), (0.7071067811865476, 0.7071067811865475)], Line[(0.0, 0.0), (0.5000000000000001, 0.8660254037844386)], Line[(0.0, 0.0), (-0.4999999999999998, 0.8660254037844387)], Line[(0.0, 0.0), (-0.7071067811865475, 0.7071067811865476)], Line[(0.0, 0.0), (-0.8660254037844387, 0.49999999999999994)]}
PolarCircles = Sequence(Circle[(0.0, 0.0), k], k, 1.0, 50.0, 1.0)
Q: (TH, f(TH))
showGrid = true
showRay = true
b: xAxis
TL = Corner(4.0)
d: x(TL)
e: y(TL)
ThetaLabel: "θ = " + TH