|
|
researchv10 Norman
#include <math.h>
#include <stdio.h>
#include "tek.h"
parabola(x0, y0, x1, y1, xb, yb)
double x0, y0, x1, y1, xb, yb;
{
register double x, y, t;
double c0x, c0y, c1x, c1y;
double dt, d2, d1;
d1 = sqrt((xb - x0) * (xb - x0) + (yb - y0) * (yb - y0));
d2 = sqrt((xb - x1) * (xb - x1) + (yb - y1) * (yb - y1));
if (d1 <= e1->quantum || d2 <= e1->quantum) {
line(x0, y0, x1, y1);
return(0);
}
c0x = x0 + x1 - 2. * xb;
c1x = 2. * (xb - x0);
c0y = y0 + y1 - 2. * yb;
c1y = 2. * (yb - y0);
move(x0, y0);
dt = e1->quantum / d1;
if(e1->grade != 0.)
dt /= e1->grade;
for (t = dt; t < 0.5; t += dt) {
x = (c0x * t + c1x) * t + x0;
y = (c0y * t + c1y) * t + y0;
vec(x, y);
}
dt = e1->quantum / d2;
if(e1->grade != 0.)
dt /= e1->grade;
for (; t < 1.0; t += dt) {
x = (c0x * t + c1x) * t + x0;
y = (c0y * t + c1y) * t + y0;
vec(x, y);
}
vec(x1, y1);
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.