#include <stdio.h>
#include <stdint.h>
#include <math.h>

#define CENTER 127

void rotate(int *x, int *y, float a){
	int tx = *x - CENTER;
	int ty = *y - CENTER;
	tx = tx * cos(a) - ty * sin(a);
	ty = tx * sin(a) + ty * cos(a);
	ty += CENTER;
	tx += CENTER;
	*x=tx; *y = ty;
}

int x, y;
int x0 = 127;
int y0 = 127;
float r;

int main(void) {
	// your code goes here
	for(uint8_t i = 0; i<60; i++){
		x = 127; y = 200;
		rotate(&x, &y, i * 3.1415 * 2 / 60);		
		rotate(&x0, &y0, i * 3.1415 * 2 / 60);
		r = sqrt((x0-x)*(x0-x)+(y0-y)*(y0-y));
		printf("i=%d, x0=%d, y0=%d, x=%d, y=%d, r=%f\n", i,x0, y0, x, y, r);
	}
	return 0;
}
