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
scale (Number sx, Number sy) typedict.Matrix
 
Changes this matrix so that distances along the x-axis are multiplied by sx and distances along the y-axis are multiplied by sy, and returns this matrix to the caller. The mathematical description of scale says it transforms the point
(x, y)
into
(sx*x, sy*y)
which means the new and old matrices map
(1, 1)
and
(sx, sy)
into the same point.
 
 Example:   The program,
import yoix.*.*;

JFrame f = {
    Color background = Color.white;

    Graphics graphics = {
        String font = "Lucida-plain-24";
        int    textantialiasing = TRUE;
    };

    paint(Rectangle rect) {
        graphics {          // "named block"
            gsave();
            translate(72, 72);
            rotate(10);
            moveto(0, 0);
            show("wide");
            moveto(0, 36);
            scale(2, 1);
            show("wider");
            moveto(0, 72);
            scale(2, 1);
            show("widest");
            grestore();
        }
    }
};

f.visible = TRUE;
defines a paint function in a frame that draws text strings in a coordinate system that is stretched horizontally using scale after each string is printed.
 
 Return:   Matrix
 
 See Also:   concat, concatmatrix, currentmatrix, dividematrix, dtransform, Graphics, identmatrix, idtransform, initmatrix, invertmatrix, itransform, maptopixel, rotate, setmatrix, shear, transform, translate

 

Yoix is a registered trademark of AT&T Inc.