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

typedef struct {
  double x;
  double y;
} point;

double distance(point A, point B) {
  double d;
  
  d = sqrt(pow(A.x-B.x,2)+ pow(A.y-B.y,2));
  return d;
}

point * new_point(double x, double y) {
  point * A;
  A = calloc(1, sizeof(point));
  A->x=x;
  A->y=y;
  return(A);
}
  

void rotate(point * A, double theta) {
  double x, y;
  
  x = A->x;
  y = A->y;
  A->x = cos(theta)*x+sin(theta)*y;
  A->y = -sin(theta)*x+ cos(theta)*y;
}
  
  
  
int main() {
  point *A;
  
  A = new_point(0, 1);

  rotate(A, M_PI/3);
  printf ("A=%f %f\n", A->x, A->y);
}