Hey guys,

I am plotting a circle using two stepper motors. The X axis is relatively simple, stepping one step at a time. Here is the code I use to plot the circle:

```
void circle(int r){
int r2 = sq(r);
for (int i=1;i<r;i++){
x.step(1);
curx+=1;
int yts = (sqrt(r2 - (curx * curx) ) );
y.step(yts);
cury += yts;
}
}
```

I am a novice at this, and I suspect my problem has to do with the data type of int, and the limitations thereof. I have also tried using both long and signed long. Either way, I keep getting strange numbers for sq(300), usually between 25,000 and 35,000.

I understand that there is a maximum value for ints, but what data type should I be using to store numbers like 300^2: five digits?