void wheelLine(wheelPS *wps, double x0, double y0, double x1, double y1) { fprintf(wps->file, "%g %g M\n", WPS_X(x0), WPS_Y(y0)); fprintf(wps->file, "%g %g L S\n", WPS_X(x1), WPS_Y(y1)); return; }
void wheelArrow(wheelPS *wps, double x0, double y0, double x1, double y1, double alen, double awidth) { double len, dir[2], perp[2]; dir[0] = x0 - x1; dir[1] = y0 - y1; ELL_2V_NORM(dir, dir, len); ELL_2V_SET(perp, -dir[1], dir[0]); fprintf(wps->file, "%g %g M\n", WPS_X(x0), WPS_Y(y0)); fprintf(wps->file, "%g %g L S\n", WPS_X(x1 + alen*dir[0]/2), WPS_Y(y1 + alen*dir[1]/2)); if (alen && awidth) { if (len < alen) { awidth *= len/alen; alen = len; } fprintf(wps->file, "%g %g M\n", WPS_X(x1 + alen*dir[0] + awidth*perp[0]), WPS_Y(y1 + alen*dir[1] + awidth*perp[1])); fprintf(wps->file, "%g %g L\n", WPS_X(x1), WPS_Y(y1)); fprintf(wps->file, "%g %g L CP F\n", WPS_X(x1 + alen*dir[0] - awidth*perp[0]), WPS_Y(y1 + alen*dir[1] - awidth*perp[1])); } return; }
void wheelDot(wheelPS *wps, double x, double y, double rad) { fprintf(wps->file, "%g %g %g 0 360 arc closepath F S\n", WPS_X(x), WPS_Y(y), WPS_S(rad)); return; }
void wheelArc(wheelPS *wps, double xc, double yc, double rad, double angle1, double angle2) { fprintf(wps->file, "newpath %g %g %g %g %g arc S\n", WPS_X(xc), WPS_Y(yc), WPS_S(rad), angle1, angle2); }
void wheelCircle(wheelPS *wps, double xc, double yc, double rad) { fprintf(wps->file, "%g %g %g 0 360 arc closepath S\n", WPS_X(xc), WPS_Y(yc), WPS_S(rad)); return; }
void wheelGraph(wheelPS *wps, double a, double d, double f) { double A, B, C; int xi; double x, y; A = -a - d - f; B = a*d + a*f + d*f; C = -a*d*f; for (xi=0; xi<=99; xi++) { x = AIR_AFFINE(0, xi, 99, wps->bbox[0], wps->bbox[2]); y = (((x + A)*x + B)*x + C)/2; fprintf(wps->file, "%g %g %s\n", WPS_X(x), WPS_Y(wps->yscale*y), xi ? "L" : "M"); } fprintf(wps->file, "S\n"); return; }
void wheelLabel(wheelPS *wps, double x, double y, char *str) { fprintf(wps->file, "%g %g M (%s) show\n", WPS_X(x), WPS_Y(y), str); return; }