Skip to content
Snippets Groups Projects
Verified Commit 0a71b0a7 authored by Martin's avatar Martin
Browse files

reduce param requirements to speed up program

parent 50720193
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ void plot(double R, double r, double O)
int y = scale((R - r) * sin(t) - O * sin((R - r) / r * t));
if (x < 0 || x >= COLS || y < 0 || y >= LINES)
continue;
mvaddch(y, x, '.');
mvaddch(y, x, '+');
}
}
......@@ -29,6 +29,8 @@ void clearscr()
}
}
char buf[50];
int main(int argc, char *argv[])
{
initscr();
......@@ -38,9 +40,8 @@ int main(int argc, char *argv[])
{
for (double r = 0; r <= 1; r += 0.1)
{
for (double O = 0; O <= 1; O += 0.1)
for (double O = 0; O <= 1; O += 0.01)
{
char buf[50];
plot(R, r, O);
sprintf(buf, "R=%.2f r=%.2f O=%.2f", R, r, O);
mvaddstr(0, COLS - strlen(buf), buf);
......
......@@ -9,6 +9,6 @@
#include <math.h>
// number of pixels in the range t=(0, PI)
#define RESOLUTION 1000
#define RESOLUTION 100
// defines the maximum value of t = T_MAX*PI
#define T_MAX 1000
\ No newline at end of file
#define T_MAX 200
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment