I'm missing something obvious i guess. Or have some stupid mistake in my head, but anyway I can't figure it out.
My code is this.
for (int i = 0; i < ringNumber; i++)
{
float x = (radius * ringNumber) - (i * radius);
float y = (-1/2 * radius * ringNumber) - (i * 1/2 * radius);
Debug.Log ("Radius: " + radius + ", Ringnumber : " + ringNumber + ", i : " + i);
Debug.Log ("In Loop 3 Vertical : " + x + " " + y);
}
what I get is
For Radius = 2
and Ringnumber = 2
, Y
is given out as 0
both times. In my mind it should be -2 and -3. Why isn't it?
I have similar mistakes in other loos like this, but some work out just fine.
Its not that difficult math I thought -2*2/2 minus zero times something. Should be -2 or not?