Drawing Polar Grids
Learn to draw polar grids in Ruby.
We'll cover the following...
We'll cover the following...
The PolarGrid class
The to_png method we’ve used up to this point isn’t going to help us much with polar grids, so let’s just subclass Grid and rewrite to_png to be what we need it to be. We'll create a new file named polar_grid.rb. We’ll add the Grid subclass and to_png method to our file.
Code explanation
Line 4: This new to_png method starts much like the old version, computing the size of our canvas.
Line 5: In this case, though, ...