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;
			}
		}

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.