#include "lib5.h" struct xy { int x, y; }; struct dxy { double x, y; }; int w = 80; int h = 25; int val(double hz, double sec, int n) { double a = 2 * M_PI * hz * sec; return ( sin(a) + 1 ) * 0.5 * n; } void val_xy(struct dxy *hz, double sec, double add, struct xy *p) { double sec2 = sec + add; p->x = val(hz->x, sec2, w); p->y = val(hz->y, sec2, h); } void step(struct dxy *hz, double sec, double prev, double add) { struct xy p, o; val_xy(hz, sec, add, &p); val_xy(hz, prev, add, &o); if (p.x == o.x && p.y == o.y) return; show_xy_str(o.x, o.y, " "); show_xy_str(p.x, p.y, "@"); } int main(int ac, char **av) { int n = 5, m = 3, i, j, run_sec = 10; double hz = 100; struct dxy hzs[] = { { 0.23, 0.49 }, { 0.33, 0.19 }, { 0.41, 0.31 } }; double t = 1.0 / hz, ela, nt = 1; double sta = sys_sec(), sec, prev = 0; w = opt_int("-w", ac, av, w); h = opt_int("-h", ac, av, h); run_sec = opt_int("-sec", ac, av, run_sec); cls(); while ((sec = sys_sec() - sta) < run_sec) { for (i=0; i