Plotting a circle with system.drawing including rotated labels
Posted on 2007-09-28
I am trying to use system.drawing to draw a circle divided into a variable amount of points, with a text label at each of the points, preferably at an angle matching the current point on the circle (so the labels 'fan out' from the center).
Before I attempt to try and stitch this into my database backend, the first thing I'm trying to do is simply draw the circle as a series of connected points. Something along these lines
for t = 1 to 360 step 10
x = cos(t)
y = sin(t)
pts(cpt) = New Point(x,y)
g.DrawCurve(New Pen(Color.Red), pts, 0.8F)
Although obviously with a bit more too it than that. However, I don't think my maths is quite up to the task, and the above method doesn't take into account the labels, so probably isn't the way to go anyway.
I should make it clear I'm not just trying to draw a circle - I'm trying to plot points and arrange them in a circle, if that makes sense.
Been searching Google, but can't really find anything about drawing a circle from scratch.