0

So I have a boolean representation and inside that representation contains shapes. All the points of the shape must be true in the boolean array. For some reason its not putting the points on the array. Here is my code, please help me!

for (int d = 0; d < 360; d++)
		{
			for(int r = 0; r < (int)(this.diameter/2); r++)
			{
				 double x = r * Math.cos(Math.toRadians(d));
				 double y = r * Math.sin(Math.toRadians(d));
				 booleanRepresentation[(int)(x + (this.x + (this.diameter/2)))][(int)(y + (this.y + (this.diameter/2)))] = true;
			}
		}
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by leiger
0

A circle has an infinite number of "points"... or zero... depending on how you look at it.

Not sure exactly what you're trying to do either. Could you add comments, or post the same snippet of code that you're using for a different shape (e.g. rectangle) so that I can compare?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.