Hello,

I am studying the grid code to get a better understanding of it and I got stuck at a specific. Before anything let me say, before coming here to ask I really tried to understanding by myself, spent most of a dat searching about, I don’t know if I am searching the right terms, and trying to draw the situation, but couldn’t wrap my head around.

```
// get left extent
double xb1 = x;
double yb1 = y;
// to the left
newpos(ref xb1, ref yb1, angle - 90, diagdist / 2 + distance);
```

```
static void newpos(ref double x, ref double y, double bearing, double distance)
{
double degN = 90 - bearing;
if (degN < 0)
degN += 360;
x = x + distance * Math.Cos(degN * deg2rad);
y = y + distance * Math.Sin(degN * deg2rad);
}
```

I can understand that before this, the code used the max and min values of x and y to build a rectangular area and get the center and then use said center in the formula above to do some sort of rotation, but I couldn’t follow based on the variables used