main () { int x,y, poziom, pion; float t; printf("\nWYKRES FUNKCJI:\n\n "); for (x=0; x<szer; x=x+1) for (y=0; y<wys; y=y+1) rysuj(x, y, ' '); pion = interpoluj(0, dol_x, gora_x, szer); for(y=0; y<wys; y=y+1) rysuj(pion, y, '|'); poziom = interpoluj(0, dol_y, gora_y, wys); for(x=0; x<szer; x=x+1) rysuj(x, poziom, '-'); rysuj(pion, poziom, '+'); for (t=srodek; t<zakres; t=t+skok) rysuj(f_x(t), f_y(t), '*'); for (y=wys-1; y>=0; y=y-1) { for (x=0; x<szer; x=x+1) printf("%c", rysunek[x][y]); printf("\n "); } printf("\n\n"); }
double y_force(int index) { double f = 0.0; int i = 0; for(i = 0; i < 2; i++ ) { if(i == index) continue; f += f_y(&bodies[index], &bodies[i]); } return f; }
int lorentz(int times, double step) { double x = 5; double y = 20; double z = -10; FILE* fp; fp = fopen("data/lorentz.csv","w+"); for (int i = 0; i < times; i++) { x += step * f_x(x,y); y += step * f_y(x,y,z); z += step * f_z(x,y,z); fprintf(fp,"%lf,%lf,%lf\n",x,y,z); } fclose(fp); return 0; }
void call_f_y() { y a1 = {0,}; f_y(a1); }