[ create a new paste ] login | about

Link: http://codepad.org/UjwMwOZK    [ raw code | output | fork ]

C, pasted on Oct 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <math.h>
#define A 1.0
#define B 2.0
#define ALPHA (M_PI / 6.0)

int main() {
  double x, y, theta;
  int i;
  for (i = 0; i <= 360; i++) {
    theta = M_PI / 180.0 * i;
    x = A * cos(theta);
    y = B * sin(theta + ALPHA);
    printf("(x, y) = (%6.3f, %6.3f)\n", x, y);
  }
  return 0;
}
/* end */


Output:
1
2
3
In function `main':
undefined reference to `sin'
undefined reference to `cos'


Create a new paste based on this one


Comments: