this is a homework question, so I'm not looking for an answer. But I have no idea how to start. My gut tells me some sort of integration over the arc length is involved, but I'm not sure how.
Given a spiral $r = \theta, \theta \in \left[0, 6\pi\right]$ drawn to fill a box 1000x1000 pixels wide, what is the minimum number of line segments needed to approximate this spiral within one pixel. That is, no part of any line may be more than 1px off of the true spiral.
I would appreciate any guidance.
Once you get started the approach ja72 gave to your circle drawing problem will work well. Take the starting point of a segment as 1 pixel outside the spiral. Compute the radius at that point. The radius will be decreasing as you go out. Use the starting radius to establish the length of the segment. Draw a line segment that length to a point 1 pixel outside your spiral. This will give you a practical approach, but the line segments are a little shorter than necessary because the curvature is decreasing. If you truly want the minimum, you will need to find the maximum distance the spiral is outside your line segment, which will probably be less than one pixel. Lengthen the line segment until you get to where the spiral goes outside by exactly one pixel and repeat. You may have to search both directions as you get very close to the center because the curvature is changing so rapidly there.