0

How can I plot theta = pi/4 in sage?

I tried doing the following

p4 = polar_plot(lambda x: pi/4, 0, 2*pi, rgbcolor=hue(0.6))
p4.show()

but it doesn't show the desired figure.

p4 = polar_plot(lambda x: x, 0, 2*pi, rgbcolor=hue(0.6))
p4.show()

shows archimedes spiral. It seems that lambda x is r.

Mestica
  • 1,489
  • 4
  • 23
  • 33

1 Answers1

1

According to the documentation for polar_plot, the function plotted "polarly" is the radius, with whatever variable you put in as the variable for the angle (in radians). Indeed, polar_plot(pi/4, 0, 2*pi, rgbcolor=hue(0.6)) would be sufficient for your first plot.

As far as actually plotting what you really want, I don't think you could do it with polar_plot as it stands. However, you could certainly do a parametric plot, like

parametric_plot((x*cos(pi/4),x*sin(pi/4)),(x,0,10))

but I'm not sure if that is what you are going for.

kcrisman
  • 4,374
  • 20
  • 41