home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
historic
/
v941.tgz
/
icon.v941src.tar
/
icon.v941src
/
ipl
/
gprocs
/
xform.icn
< prev
next >
Wrap
Text File
|
2000-07-29
|
1KB
|
61 lines
############################################################################
#
# File: xform.icn
#
# Subject: Procedures to transform points
#
# Author: Ralph E. Griswold
#
# Date: October 1, 1997
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# This file contains procedures that manipulate points representing
# vertices.
#
############################################################################
#
# Links: calls, gobject
#
############################################################################
link calls, gobject
procedure p_xlate(call, x, y)
local point
every point := invoke(call) do {
point.x +:= x
point.y +:= y
suspend point
}
end
procedure p_scale(call, factor)
local point
every point := invoke(call) do {
point.x *:= factor
point.y *:= factor
suspend point
}
end
procedure p_rotate(call, angle)
local point, radius
every point := invoke(call) do {
radius := sqrt(point.x ^ 2, point.y ^ 2)
point.x *:= radius * cos(angle)
point.y *:= radius * sin(angle)
suspend point
}
end