The picture language example in the SICP book discusses the notion of a frame:
A frame can be described by three vectors—an origin vector and two edge vectors. The origin vector specifies the offset of the frame’s origin from some absolute origin in the plane, and the edge vectors specify the offsets of the frame’s corners from its origin.
The book then goes on to say that if we have an image described in terms of points in the unit square, we can map a given point, (x, y)
, to a point within a new frame, f
, using the following formula:
origin(f) + x * edge1(f) + y * edge2(f)
where +
and *
are defined as vector arithmetic operators:
(x1, y1) + (x2, y2) = (x1 + x2, y1 + y2)
and
k * (x, y) = (kx, ky)
.
Using this formula, if I define a frame as
origin = (1, 1); edge1 = (3, 1); edge2 = (1, 3)
the point (1, 1)
from the unit square maps to (5, 5)
; whereas it seems like it ought to be `(3, 3).
What am I not getting?