Created
May 21, 2020 02:15
-
-
Save ismaeldamiao/553c08676881dc919a70193de561dc67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<math.h> | |
int main(void){ | |
double x, y, theta, dt = 0.01; | |
FILE *arquivo = fopen("pontos.dat", "w"); | |
for(theta = 0.0; theta <= 2.0 * M_PI; theta += dt){ | |
x = 2.0 * cos(2.0 * theta) * cos(theta); | |
y = 2.0 * cos(2.0 * theta) * sin(theta); | |
fprintf(arquivo, "%g %g\n", x, y); | |
} | |
fclose(arquivo); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment