#include<stdio.h> #include<math.h> int main() { double R; double omega; double x, y,t; R=6.2; omega=0.1; t=0; x=R*cos(omega*t); y=R*sin(omega*t); printf("t=%lf\n x=%lf\n y=%lf\n",t, x, y); }
/usr/bin/ld: /tmp/ccf5Bi7l.o: in function `main': circle.c:(.text+0x5e): undefined reference to `cos' /usr/bin/ld: circle.c:(.text+0x7b): undefined reference to `sin' collect2: error: ld returned 1 exit status
gcc test.c -lm
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)