Subj : Re: fill in a segment of a circle on a graph To : comp.programming From : Joe Wright Date : Mon Sep 05 2005 11:07 am aiiadict@gmail.com wrote: > hi, > > segment of circle = 45degree (constant) "pie slice" > radius of circle = variable, and known > angle = variable and known (this the angle of line running through > center of the pie slice, the slice extending 22.5 degrees to each side > of this line) > > > goal: > > 0,0 on a graph is the center of the circle > > input: > > 1)angle = 0 degrees for example, compass direction North > 2)radius (30, for example) > > what coordinates would be included in this slice? > > I want the coordinates of all cells outlined by the circle segment. > > I could draw the arc, and the edges of the slice, and then use > some sort of fill routine. I thought perhaps someone here would > know a neat algorithm. > > Bresenhams algorithm looks like it would work, but I haven't > figured out the code yet. Trying to get it to do any segment > of an arc is taking me a while to figure out. > > Rich > Instead of asking someone to do it for you, imagine someone told you it was impossible. Prove them wrong by doing it yourself. -- Joe Wright "Everything should be made as simple as possible, but not simpler." --- Albert Einstein --- .