AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
quadto (Number x1, Number y1, Number x2, Number y2) typedict.Path
 
Adds a quadratic curve to this path that extends from the current point, if there is one, to (x2, y2), which becomes the new current point, and uses (x1, y1) as the control point. The points are all transformed using the CTM associated with this path when quadto is called, which means subsequent changes to CTM do not affect this curve. If this path is empty quadto will abort with a nocurrentpoint error.
 
 Example:   The program,
import yoix.stdio.*;

Path p;

moveto(x, y) = printf(" moveto(%.1f, %.1f);\n", x, y);

quadto(x1, y1, x2, y2) {
    printf(" quadto(");
    printf("%.1f, %.1f, ", x1, y1);
    printf("%.1f, %.1f", x2, y2);
    printf(");\n");
}

p.moveto(100, 100);
p.quadto(200, 200, 500, 300);

printf("Output before CTM change:\n");
p.pathforall(moveto, NULL, quadto, NULL, NULL);
p.CTM.scale(2, 2);
printf("\nOutput after CTM change:\n");
p.pathforall(moveto, NULL, quadto, NULL, NULL);
prints something like
Output before CTM change:
 moveto(100.0, 100.0);
 quadto(200.0, 200.0, 500.0, 300.0);

Output after CTM change:
 moveto(50.0, 50.0);
 quadto(100.0, 100.0, 250.0, 150.0);
on standard output. Notice how the coordinates changed after we scaled the CTM associated with the path.
 
 Return:   Path
 
 See Also:   arc, arcn, closepath, currentpath, currentpoint, curveto, flattenpath, Graphics, lineto, moveto, newpath, pathbbox, pathforall, rcurveto, rlineto, rmoveto, rquadto

 

Yoix is a registered trademark of AT&T Inc.