+ All Categories
Home > Documents > GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a...

GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a...

Date post: 23-Jun-2020
Category:
Upload: others
View: 5 times
Download: 1 times
Share this document with a friend
81
GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP, RELEASE 1.0 by John Alan McDonald MichaelSannella TECHNICAL REPORT No. 224 October 1991 Department.ofStatistics, GN-22 University of Washington Seattle, Washington 9819S USA
Transcript
Page 1: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN

COMMON LISP, RELEASE 1.0

by

John Alan McDonaldMichaelSannella

TECHNICAL REPORT No. 224

October 1991

Department.ofStatistics, GN-22

University of Washington

Seattle, Washington 9819S USA

Page 2: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Geometry: a package for basic geometric calculation inCommon Lisp, release 1.0

JOHN ALAN McDoNALD

MICHAEL SANNELLA ..

Depts. of Statistics, Computer Science and Engineering,University of Washington

October, 1991

Abstract

This document describes the Geometry module, a component of a system called Arizona,now under development at the U. of Washington. The Geometry module is intended to supportcommon geometric calculations arising in graphics, numerical linear algebra, optimization, andscientific computing in general. The goal is to allow geometric computation using abstractionsthat directly represent high level mathematical concepts like affine spaces, vectors, and lineartransformations, while retaining the level of performance provided by traditional scientific sub­routine packages like Linpack[4]. It will be derived from Cactus [8, 6] and improved with ideasfrom work by DeRose [1, 2, 3] and Segal [14]. However, this release of the Geometry module doesnot support general geometric calculations. It consists of two submodules specialized for highperformance in simple graphics calculations, Reeded by the SlateaJld Chltrt module$discnssedbelow. TheS?reenaeometrysublllodulesupp0l'tspa,lcullttions inadiscretetwo-.dilllenj>icmal co­ordinatesyst7mCalled Screen Space, ie.· abitmappeddisplay. The Chart Geometry submodnlesupports calculations in a continuous (float) two-dimensional coordinate system, called ChartSpace, a natural world space for simple scientific diltgrams. In addition, the Geometry moduleprovides affine mappings between the Chart and Screen spaces.

*This work was supported in part the Dept.from the National Library of Medicine.

En.ergy wader c<mtJract FGOO85-ER25000 and by NIH grant LMo4174

Page 3: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

2

Contents

1 Overview

22.12.22.32.42.5 Screen

2.lU Abstract Type .2.6 Geometric Calculations

3

34444566

3

3.5Amn;ra,ct Type .

3.6 Geometric Calculations ..

77778899

4 Transforming between Chart and Screen Coordinates

5 Calculating Tic Positions

6 Reference Manual

9

9

11

Page 4: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

3

1 Overview

Al'iiZOllla, now underThis doc:um.ent describes the ue()m€~trymoduJe, a COIlllpC)nelilt of a sysl~em

de.'eJopm,ent at Washington.AdditonllU Tfm(l,Tts describe the other CUI'rel1ltJy released modules in Arizona, Slate and Chart

[12,inten(Jed to be a of tools supporting scientific

conllpultin,g, ql11aIlltitiltti\re gJraphics, and in Common and CLOS (theCommon Lisp Object System) [15}. This document assumes the reader is familiar with CommonLisp and CLOS. An overview of Arizona is given in [5} and an introduction to the current release isin [9}.

The code implementing the Geometry module is found somewhere like az/geometry/. All defi­nitions are in the Geometry pa.~ka.ge, ni(:knaUled

However, this release of the Geometry module does not support general geometric calculations. Itconsists of two submodules specialized for high performance in simple graphics calculations, neededby the Slate and Chart modules discussed below. The Screen Geometry submodule supports calcu­lations in a discrete two-dimensional coordinate system called Screen Space, ie. a bitmapped display.The Chart Geometry submodule supports calculations in a continuous (float) two-dimensional coor­dinate system, called Chart Space, a natural world space for simple scientific diagl'ams. In addition,the Geometry module provides affine mappings between the Chart and Screen spaces.

These two submodules no use of CLOS, of the relatively low peltfO]rmaUi~e

betterpossible to reduce the size of these two submodules and also better support extension to higher levelgeometric calculations, for example, that will be possible, with performance, to replace(screen-point-xp)by a combination of (declare (type Screen-Point p)) (point-x p).

The

plp,elme. Itcalculations with these re@;iollSrepresenting other geo,metric 15IHtpe:>.

Page 5: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

4 2

2.1 Scre.en Objects

A g:Screen-Object is one of g:Screen-Vector, g:Screen-Point, or g:Screen-Rect, are del,ellbedbelow.

2.2 Screen Coordinates

g:Screen-Coordinate is a datatype for the possible values of a point on a slate:Screen or slate:Slate(see It will be a subtype of Integer and usually a subtype of Fixnum.

g:Positive-Screen-Coordinate is a data type for the possible values of the width, height, etc., of ascreen object. g:Positive-Screen-Coordinate really means non-negative; it will be a subtype of (Integer0*).

g:Screen-Coordinate-Listandg:Positive-Screen-Coordinate-List are types supplied to make it con­venientto check ifallthe coordinates in a list are legal.

2.3 :Sc:reen Vectors

The abstract typeg:Screen-Vector displacements ona screen.g:Screen-Vector has con­structor g:make-screen-vector, equality predicate g:equal-screen-vectors?, and copier g:copy-screen­vector. The coordinates of a screen vector can be read (and set with setf) using g:screen-vector-x andg:screen-vector-y

The coordinates of a g:Positive-Screen-Vector are both g:Positive-Screen-Coordinates.g:Screen-Vector-List and g:Positive-Screen-Vector-List are types provided for convenience.Screen vectors are often used to hold intermediate results; to avoid the overhead of cons-ing and

gc-ing many small objects, we provide a resource of temporary vectors. Vectors can be explicitlyborrowed from and returned to the resource using g:borrow-screen-vector and g:return-screen-vector.

variable vectorllsing the

GliiPITlliitlty pacJc<l>g;e prov'ld~~s the oper<lLticlns on vectors: g:linear-mix-screen-vectors, g:subtract-screen-vectors, g:screen-vector-12-norm2, g:screen-vector~12-norm, and g:screen-vector-Il-norm.

2.4 Screen Points

Theg:screen-

The Ge()m~~try Pa<:kalge l)JWVildes the tolJlowinl'( algebr'aic op(ora'l;iollS on screen g:move-

Page 6: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

2.5 Screen Rects 5

screen-rect-leftI screen-rect-rightI Iv v

.xxxxx. <--screen-rect-top

.xxxxx .

.xxxxx.<--screen-rect-bottom

Figure 1: Screen Rect coordinates

2.5 Screen Reets

A Screen-Reet is a screen rectangle whose sides are p.arallel to the coordinate axes. Other namesare commonly used for this, including rectangle and region. We use Screen-Rect because we want toreserve rectangle for general rectangles and region for more general specifications of sets of pixels.We welcome any suggestions for names that are better than Screen-Reet. (One we have consideredis 2D-Interval, but it seems too verbose.)

We use a coordinate system where x increases from left to right, and, unfortunately, like mostwindow systems, y from top to bottom.

Screen-Rects have the following generalized accessors:screen-rect-xmin, screen-rect-xmax, screen-rect-ymin, screen-rect-ymax,screen-rect-left, screen-rect-top, screen-rect-right, screen-rect-bottom,screen-reet-width, and screen-reet-height.

At present, all rects are represented internally by xmin, width, ymin, and height slots. For Screen­Reets, xmin is equivalent to left, and ymin to top. The internal representation may be changed atany time.

The external interface for making Screen-Rect's make-screen-rect takes any two of :Ieft, :right, and:height and any two of :top, :bottom, and :width.

Because of the pernicious danger of fence post errors, we give a careful description of which pixelsthe various coordinates refer to, and also give names to common alternative specifications:

The (screen-rect-left,screen-rect-right) and(screen-reet-top, screen-reet-bottom) pairs are specifications of integer intervals like the (start, end)

anallogous param,eteriza1tion m top··to-botlGom coordillate:s.

make this a little2.

For eX<lmj:>le, imple:memt,ati<:>ns of the dr,~wJlng operalticms will often need to transform to theThis means our unneJ(-le,n,

that andscreen-rect-top the coordinate of the topmost row that intersectsthe screen-recto Screen-reet-right is the coordinate of the first column not intersecting the Screen­Rect to the right and screen-reet-bottom is the coordinate of the first row below the Screen-Rect notinl;erl:lectinlg it. (See This means that screen-rect-width screen-reet-right - screen-reet-left is the of that intersect the screen-reet-height= screen-reet-bottom - screen-reet-top is the of rows that intersect the andscreen-reet-width *' is the or in the screen-recto

l"P.,l1ll1·P IlJltertacmg with other paJranrIeterizatiolJlS; toshown in

Page 7: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

6

outer...leftlinner"'leftII inner"'rightII Iouter-rightII IIvv vv....... <-outer-top.xxxxx. <-inner-top.xxxxx .. xxxxx. <-inner-bottom....... <-outer-bottom

Figure 2: Other Screen Rect coordinates

2

inner-bottom, width, height) representation to the coordinates of the (inner-left, inner-top, width,height) in the top-to-bottom coordinates.

There's a natural ambiguity about what's supposed to happen when we change the coordinatesof a Rect. When we change the right coordinate, does that mean translating the Rect rigidly so itswidth remains fixed, or does it mean leaving the left coordinate fixed and changing the width.

We have adopted the convention that setting any of the bounds (left, right, top, bottom, outer­left, etc.) of the Rect is interpreted as changing the origin, that is, a translation of the Rect withoutchanging its extent (width and height). Setting the width and height changes the size or shape ofthe Rect, holding the origin fixed. This convention applies to both Screen and Chart Rects.

Width and height must be non-negative. Zero width and zero height are taken to imply an emptyscreen-recto A width and height of 1 means the Screen-Rect covers one pixeL Empty screen-rectsstill have a location.

2.5.1 The Abstract Type

The constructor for g:Screen-Rect is g:make-screen-rect; the equality predicate is g:equal-screen-rects?;and the copier is g:copy-screen-rect.

In addition to the coordinate accessor functions discussed above, screen rects have accessors thattake vectors and points.

mte:rm(~dia.te result.s; toprClVl([e a resiOurce of temporary reets. Reets can be e:X;lph,cltlly borr'oVlred

returrled to the re8iQurce g:borrow-screen-rect and g:return-screen-rect. However, itis reCiOnlm.en<ied to bind a to a reet macro g:with-

2.6 Geometric UalICllla.tu)Ds

Geomletl'y nl'o\rjdl~S functions for a number of common calculations.tests whether one reet is inside another.

and test whether are a rect.

Page 8: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

tests wl1LetJller two reets int;er~;eelt; g:intersect-screen-rects returns

7

reetthat

g:s(;reen-rect-eovering-rects returIIS the sU1Lalllest reds in a list. g:screen-rect-covering-points the reet eOIlta,ining all points a list. g:extend-screen-rect-to-point

cmrerJrng a reet g:extend-screen..rect-to-rect returns the smallestreet two rects.

g:screen-rect-min-12-dist2 and g:screen-rect-min-12-dist compute the minimum betweentwo

g:screen-distance-to-line computes the £2 distance between a point and a line segment.

3 Chart Geometry

[11}.Like the Sereen Geometry module, Chart Geometry provides an affine space of chart points

and vectors and an algebra of operations on those points and vectors. It also provides objectsrepresenting simple rectangular regions and functions for standard calculations with these regions(eg. intersection). It may be extended in the future to include objects representing other geometricshapes.

3.1 Chart Objects

A g:Chart-Obj~ct is oneofg:Chart-Vector, g:Chart...Point, org:Chart-Rect, which are described below.

3.2 Chart Coordinates

g:Chart-Coordinate is a datatype for the possible values of a eoordinate on a slate:Chart (see [11]).It's safe to assum¢ it is a subtype of Float. g:Positive-Chart-Coordinateis a data type for the possible

of the width, height, etc., of a ehartobjeet. "Positive" really means non-negative; it's saretoassuU1Le it is a subtype ofeEloat 0.0 *). g:Chart-Coordinate-list and g:Positive-Chart-Coordinate-listare types SUj:>plled

3.3 Chart Vectors

The abs:tract

vector-y

convenience.vectors are often results; to avoid the overhead of COllS-lLn,; and

many small we a resource of veetors. Vectors can be eXI?li<:itlyborrowed from and returned to the resource

Page 9: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

8 3 CHART GEOMETRY

Hc'W€:ve:f. it is (and to locally bind a to a vector themacro g:with-borrowed-chart-vector.

GeOllJletlry pacJ,~:esupports a chart vector g:linear-mix-chart-vectors, (and two spe-cial cases: g:add-chart-vectors and g:subtract-chart-vectors) It also provides some simple metric func­tions: g:chart-vector-12-norm2, g:chart-vector-12-norm, and g:chart-vector-Il-norm.

3.4 Chart Points

The abstract type g:Chart-Point represents locations on a chart. g:Chart-Point has constructorg:make-chart-point, equality predicate g:equal-chart-points?, and copier g:copy-chart-point. The coor­dinates of a chart point can be read (and set with setf) using g:chart-point-x and g:chart-point-y

The coordinates of a g:Positive-Chart-Point are both g:Positive-Chart-Coordinates.g:Chart-Point-list andg:Positive-Chart-Point-list are types provided for convenience.Chart points are often used to holdintermediate results; to avoid the overhead of cons-ing and gc­

ing filany smallobjects, a resource of temporary points. Points can be explicitly borrowedfrom and ret'Urned to the resource using g:borrow-chart-point and g:return-chart-point. However, itis recomlllended(and safer) to locally bind a variable to a temporary point using the macro g:with­borrowed-chart-point.

The Geometry package provides the following algebraic operations on chart points: g:move-chart­point and g:subtract-chart-points.

3.5 Chart Reds

A Chart-Rect is a chart rectangle whose sides are parallel to the coordinate axes. Other namesare commonly used for this, including rectangle and region. We use Chart-Rect because we want toreserve rectangle for general rectangles and region for more general sets in the plane. We welcomeany suggestions for names that are better than Chart-Reet. (One we have considered is 2D-Interval,but it seems too verbose.)

We use a coordinate system where x increases from left to right, and, in the natural way forquantitative graphics, but unlike most window systems, y from bottom to top.

Chart-Reets have the following generalized accessors:chart-rect-xmin, chart-reet-xmax, chart-rect-ymin, chart-reet-ymax,chart-rect-Ieft, chart-reet-top,chart-rect-right, chart-reet-bottom,chart-reet-width, and chart-rect-height. At present, all rects are represented internally by xmin, width,ymin, and height to

llla.,kinlgl..hart-It<ec:t's 1113ike-·ch;art··rec:t takes any two of :Ieft, :right, andinternal representation may be changed at any

time.the coordinates

so itscJlamgmg the width?

botto,m, outer-

of

Page 10: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

3.6 Ge'Qmetric Calculations 9

3.5.1 The Abstract Type

The constructor for g:Chart-Rect is g:make-c:hart-rect; the is g:equal-c:hart-rects?;and the is g:c:opy~chart~rect.

In to accessor functions discussed above, chart rects have accessors thattake vectors

g:chart-rect-origin (and sets with setf) the upper left corner of the rect. g:chart-rect-extentwith vector to the diagonal (width, height) of the recto

Chart rects are often used to hold intermediate results; to avoid the overhead of cons-ing and gc­ing many small objects, we provide a resource of temporary rects. Rects can be explicitly borrowedfrom and returned to the resource using g:borrow-chart-rect and g:return-chart-rect. However, it isrecommended (and safer) to locally bind a variable to a temporary reet using the macro g:with­borrowed-c:hart-rect.

3.6 Geometric Calculations

Geometry provides functions for a number of common geometric calculations.g:sllb-c:hart-rec:t? whetheronerect is inside another.g:chart-point-in-rect? and g:c:hart-points-in-rect? test whether points are inside a rectog:chart-rect-intersect? tests whether two reets intersect; g:intersect-chart-rects returns the rect

that is the intersection.g:chart-rect-covering-rects returns the smallest rect containing all rects in a list. g:chart-rect­

covering-points returns the smallest rect containing all points in a list. g:extend-chart-rect-to-pointreturns the smallest rect covering a reet and a point. g:extend-chart-rect-to-rect returns the smallestrect covering two reets.

g:chart-rect-min-12-dist2 and g:chart-rect-min-12-dist compute the minimum L2 distance betweentwo rects.

g:chart-distanc:e-to-Iine computes the L2 distance between a point and a line segment.

4 Transforming between Chart and Screen Coordinates

prl~sent, only a limited range of transforms (diagonal ones from Chart space to Screen space andspace to Chart space) are available and there are only limited facilities for constructingnrc)vH1ed only what's essential Chart [11]. This should change soon.

g:IJiagonall~L<-;'~~Miap is a type for between space, in either direction.

is actually apseudo-inverse.

To either direction of map to any g:Screen~Object or any g:Chart-Object, as appropriate,use g:transform.

g:c<->s.-chec:k-type-matc:h tests to see if the transform are of apprc,priately mittcJllll1tgfor one and one lr:l.hart~l~el:t.

5 Calculating Tic Positions

This sections contains some utilities for ch()osJlng nice tic mark sets for scil:mtific dia.grluIls.derived from code Jan Pedersen and Robert Gentleman.

It is

Page 11: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

10 GAJLGl..TLATIf"G TIC POSITIONS

enl:apsulated inpre:dlcate for

Delscripti,ons of where (inmstances of the abstract g:Tics which are mten<ledg:Tics is eql11ality predicate is equal-tics?

An g:Tics covers an from (g:tic-min x) to (g:tic-max x), with tics placedevery (g:tic-inc suy:rport equally sized The number of (g:tic-n x),should be (+ 1 tic-max tic-min) tic-inc» (tellCf!];>08ts!)

g:get-nice-tics is the basic function for computing tic marks. tics argument is a list ofnumbersof tic marks to try, that with the default value, the heuristic first tries fitting 3 tic marks, then 4,and so on up to 8, picking the resulting tic interval that is closest to the original interval specifiedby (min,max).

g:tic-values returns a list of the chart coordinates at which the tics are placed. Strictly speaking,it shouldn't be needed, but it might be useful in the future if we want to generalize to non-equallyspaced tics (eg. for plotting on a log scale).

g:tic-Iabels returns a list of strings corresponding to the floating point g:tic-values. Convertingfloating point values to strings is expensive; this accessor lets us cache the conversion.

g:nice-chart-rect is a minor convenience for a common case; it saves us having to call g:get-nice-ticstwice and then modifiy a reet to be consistent with the resulting intervals.

Page 12: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

11

6 Reference Manual

The entries in this section were gellerated automatically from the Lisp source using the Definitionof Arizona

Documentation:Add <vO> and <vb. Note that it's ok for <result> to be eq to either <vO> or <vI> (or both).

Usage:(g:add-chart-vectors vO v1 tkey result)

Arguments:

vO - G:Chart-Vectorv1 G:Chart-Vectorresult G:Chart-Vector

Returns:

result

Source: #p" /belgica-2g/jam/az/ geometry/ chart-vectors.lisp"

Documentation:Add <vO> and <vI>. Note that it's ok for <result> to be eq to either <vO> or <vI> (or both).

Usage:(g:add-screen-vectors vO v1 tkey result)

Arguments:

vO - G: Screen-Vectorv1 - G: Screen-Vectorresult G:Screen-Vector

Returns:

result

Source:

Documentation:

Page 13: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Usage:(g:a.ffine-mix-chart-points aO pO a1 p1 tltey result)

Arguments:

aO - G:Chart-CoordinatepO - G:Chart-Pointa1 G:Chart-Coordinatep1 - G:Chart-Pointresult G:Chart-Point

Source: #p" Ibelgica-2g/jamlazlgeometryI chart-points.lisp"

Documentation:Computes an affine combination of <pO> and <pI>. It's ok for <result> to be eq to either <pO> or

<pI>. Since it's an affine combination, <aO> + <aI> must be equal to 1, at least to some reasonableprecision.

(g:a1::fine-m:ix-'scre'$ll--poin'ts aO pO a1 p1 "key result)

Arguments:

aOpO - G: ::;crl~en-Po1nta1 - IUlllbElr

Returns:

result

Documentation:

Page 14: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

reBom,ce, ma,km.g a new one

Usage:(g:borrow-chart-point tkey x y)

Arguments:

x G:Chart-Coordinatey G:Chart-Coordinate

Returns:

G:Chart-Point

Source:#p" jbelgica-2g/Jam/az/geometryjchart-points.lil?P"

Documentation:Borrow a rect from the resource, specifying any two of <:left>, <:right>, and <:width>, and any

two of <:top>, <:bottom>, and <:height>.

Usage:(g:borrow-chart-rect tkey width right lett height bottom top)

Arguments:

width - (Or lull G:Positive-Chart-Coordinate)right (Or Bull G:Chart-Coordinate)lett - (Or lull G:Chart-Coordinate)height - (Or lull G:Positive-Chart-Coordinate)bottom (Or lull G:Chart-Coordinate)top - (Or lull G:Chart-Coordinate)

Returns:

Source: #p" Ibelgica-2glJamlazIgeometryI chart-rects.lisp"

resource, ma,klIllg a new one

borrow-chart-vector tkey x y)

Page 15: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

14

x - G: Chart-Coordinatey - G: Chart-Coordinate

Returns:

G:Chart-Vector

Source: #p" /belgica-2g/jam/az/ geometry/ chart-vectors.lisp"

Documentation:Get a point out of the resource, making a new one if necessary.

Usag~:

(g:borrow-screen-point kkey x y)

Arguments:

x - G: Screen-Coordinatey - G:Screen-Coordinate

Returns:

G:Screen-Point

Sourc~: #p" /belgica-2g/jam/az/geometry/ screen-points.lisp"

Documentation:Borrow a reet from the resource, specifying any two of <:left>, <:right>, and <:width>, and any

two of <:top>, <:bottom>, and <:height>.

(g:borrow-screen-rectkkey width right left height bottom top)

Arguments:

width (Or lull G:Positive-Screen-Coordinate)right - (Or lull G:Screen-Coordinate)left (Or~''''''!,>,",'''' - (Or lullbottom G:Sc:relan··Cc,ordi:a~~e)

lUll G: Sc:r:eEtn-Co()rdlin;a.te

Returns:

Page 16: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

G:Sereen-Rect

15

Source:

Documentation:Get a vector out of the resource, making a new one if necessary.

Usage:(g:borrow-screen-vector tkey x y)

Arguments:

x G:Screen-Coordinatey G:Sereen-Coordinate

Returns:

G:Screen-Vector

Source: #p" /belgica-2g/jam/az/geometry/screen-vectorsJisp"

Documentation:Clip <x> closed interval [xmin,xmaxJ.

Usage:(g:bound-screen-coordinate xmin x xmax)

Arguments:

xminx

Returns:

G:Screen-Coordinate

G:Screen-Coordinate

Source:

Documentation:

Page 17: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

16

determines the allowed valnes for the coordinatesChart-Reds.

Usage:(typep x 'G:Chart-Coordinate)

Source: #p" Ibelgica.2g/jamlazlgeometryIchart~coordinatesJisp"

Documentation:A list of Cbart~Coordinates.

Usage:(1iypep.x 'G:Chart...Coordinate...List)

Source: #P" Ibelgica.2g/jamlaz/geometryIchart~coordinatesJisp"

Documentation:A Chart-Object is one of Cbart~Vector, Cbart~Point, or Chart-Recto

Usage:(typep x 'G:Chart-Object)

Source: #p" Ibelgica.2g/jamlazlgeometryIcbart~geometry.lisp"

Documentation:Cbart~Points represent locations on a cbart.

Usage.:(typep x 'G:Chart-Point)

Source: #p" Ibelgica"'2g/jamlazlgeometryIchart-points.lisp"

Documentation:Is in <r>?

(g: ch'lrt-norin1:-i:n-:z:'ec1:? p

Arguments:

Page 18: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

pr

Returns:

(Member T lil)

Source: ,#p" /belgica-2g/jam/az/ geometry/ chart-geometry.lisp"

Documentation:A list of Chart-Points.

Usage:(typepx'G:Cl:t.art-P<>int-List)

Source: ,#p" /belgica-2g/jam/az/geometry/ chart-points.lisp"

Documentation:Accessor function for x coordinate.

Usage:(g:chart-point-x p)

Arguments:

p G:Chart-Point

Returns:

G:Chart-Coordinate

Source: ,#p" /belgica-2g/jam/az/ geometry/chart-pointsJisp"

",..,;nt'" x co()rdina.te.

17

Setf

x)

Source:

Page 19: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

18

Documentation:Accessor lUIlctltOn for y coordinate.

Usage:(g:chart~point~J p)

Arguments:

p G:Chart~Point

Returns:

G:Chart-Coordinate

Source: #p" /belgica.2g/jam/az/ geometry/ chart-points.lisp"

Documentation:Sets the point's y coordinate.

Usage:(set! (g:chart-point-J p) J)

Source: #p" /belgica-2gfjam/az/ geometry/ chart-points.lisp"

Documentation:Are all the points in the list <ps> in the rect <r>?

Usage:(g:chart-points-in-rect? ps r)

Arguments:

ps G:Chart-Point-Listr G: Chart-Rect

Returns:

(Hember T lil)

Page 20: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

<Cllal'1f.lect;"Vlrrml> ,. <:c,nart":rec1f.J'm~!lX;·; <,cnart,-re'ct-Ielt>, <Cllar't-r,ect;>-'toJ», <Cltlal'1f.I'eCl;-rlf:np, <chart­At present, all rects are represented in­For <Chart-Rect>s, <x:rnin> is equivalent

Source:

Documentation:"Bottom" is an alias for "ymin".

Usage:(g:chart-rect-bottom r)

Arguments:

Returns:

G:Chart-Coordinate

Source:

of the border co()rdinates of a red is mter}:lrelGed as a transla-ti.on.

Page 21: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

center of <r>.

G:Chart-Point

r - G:Chart-ll.ect

.Retm'ns the smallest reet containing all points in a list.

Usage:(g:chart-rect-covering-points ps &key result)

Returns:

Arguments:

Arguments:

ps - G: Chart-Point-Listresult G:Chart-ll.ect

Returns:

result

Source: #p" Ibelgica-4g/jaanjaz/geometryIchart-geometry.lisp"

In

rs G:Chart-ll.ect-Listresult G:Chart-ll.ect

Page 22: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

21

Returns:

result

Source: #p" Ibelgica-2g/jamlazIgeometryIchart-geometry.lisp"

Documentation:The smallest reet containing the circle defined by <center> and <radius>.

Usage:(g:chart-rect-enclosing-circle center radius ikey result)

Arguments:

center G:Chart-Pointradius - G: Chart-Coordinateresult - G:Chart-Rect

Returns:

result

Source: #p" Ibelgiea-2g/jamlazlgeometryI ehart-geometry.lisp"

The extent is the vector from the lower left to the upper right.The of a red is a vedor whose coordinates are its width and height. The origin of a

reet is a point. Which we use is determined by the coordinate system and thedesire the sum of be the opposite corner of the recto Therefore,

the origin is xmin-ymin corner; for Chart-Red's, it's the xmin-ymax corner.

chart-rect-extent r ikey result)

Arguments:

r - G: Chart-Reet

Returns:

result

Page 23: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

(g:chart-rect-extent r) v)

#p"lbelgica-2g1jamlazlgeometry/ chart-rects.lisp"

Returns:

G:Positive-Chart-Coordinate

Arguments:

r - G: Chart-Rect

width scaling.

Page 24: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

(lleaber T lil)

Source: #p" /belgica-2g/jam/az/geometry/ chart-goometry.lisp"

Documentation:is an alias for "~.~;•."

(g :ch'lXt-reict·-left r)

Arguments:

r - G: ChCIXt-Rect

Returns:

G:ChCIXt-Coordinate

border coordinates of a reet is interpreted as a translation.

Source:

Page 25: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

two of tworects.

Usage:(g:chart-rect-min-12-dist rO rl)

Arguments:

rO - G: Chart-Rectrl G:Chart-Rect

Returns:

Source.: #p"lbeIgica~2g/jam/azIgeometryIchart-geometryJisp"

Documentation:The L2 distance (squared) between the closest two points of the two rects.

Usage:(g:chart-rect-min-12-dist2 rO rl)

G:Chart-RectG:Chart-Rect

Returns:

G:Positive-Chart-Coordinate

Usage:

Page 26: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Arguments:

r G:Chart-B.ectresult G:Chart-Point

Returns:

result

Source: #p" Ibelgica-2g/jam/az/geometrylchart-rectsJisp"

origin of is interpreted asa translation.

Usage:(setf (g:chart-rect-origin r) p)

Source: #p" Ibelgica-2g/jam/azlgeometryIchart-rects.lisp"

Documentation:"Right" is an alias for "xmax".

Usage:(g:chart-rect-right r)

Arguments:

r G:Chart-B.ect

G:Chart-Coordinate

Source:

U1l,an,gul,g any of the coordinates of a rect is interI,relGed as a translation.

Page 27: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

26

Documentation:is an alias for "ymax".

Usage:(g:chart-rect-top r)

Arguments:

r G:Chart-Rect

G:Chart-Coordinate

Source: #p" jbelgica-2gjjamjaz jgeometryjchart-rectsJisp"

Documentation:Changing any of the border coordinates of a reet is interpreted as a translation.

Usage:(sett (g:chart-rect-top y)

Source: #p" jbelgica-2gjjamjazjgeometry j chart-reets.lisp"

Documentation:<r>.

Usage:(g:chart-rect-width r)

r G:Chart-Rect

Returns:

G:Positive-Chart-Coordinate

Page 28: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Ub.an;!SlIl.g a reet's width or height is interpreted as a scaling.

Usage:(sett (g:chart-rect-width r) x)

Source: #p"/helgica-2g/jam/az/ geometry/ chart-reets.lisp"

of <r>.

Arguments:

r G:Chart-Rect

Returns:

G:Chart-Coordinate

Documentation:Changing any of the horder coordinates of a reet is interpreted as a translation.

Source: #p" /helgica-2g/jam/az/geometry/chart-rects.lisp"

of <r>.

Page 29: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

r G:Chart-&ect

Returns:

G:Chart-Coordinate

Source: #p" Ibelgica..2g/Jam/az/geometryIchart-reds.lisp"

Documentation:Changing any of the border coordinates of a red is interpreted as a translation.

Documentation:The top of <r>.

Usage:(g:chart-rect-ymax r)

Arguments:

r

Returns:

G:Chart-Coordinate

Source:

border eo()rdina,tes ala red

Page 30: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

<r>_

29

Usage:($I: :ehaLrt--rect-·ymiLn r)

Arguments:

r - G: Chart-Reet

Returns:

G:Chart-Coordinate

S9urce: #p"/belgica-2g/jam/azlgeometry/chart-rects.li~p"

Documentation:Changing any of the border coordinates of a rect is interpreted as a translation.

Usage:(setf (g:ehart-reet-ymin r) y)

Source: #p" Ibelgica-2g/jamlazlgeometryI chart-rectsJisp"

Documentation:A Chart-Vector represents displacements on a chart.

Usage:(typep x 'G:Chart-Veetor)

Source: #P" Ibelgicar2g/jamlazlgeometryI chart-vectors.lisp"

Documentation:Comrmtles the L2 norm of <v>.

(g::: char1:;-'lTeC1~or-l:l-n;orm 'IT)

'IT - G:Chart-Vector

Returns:

Page 31: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

30

Source:

Documentation:Computes the L2 norm of <v>.

Usage:(g:chart-vector-12-norm v)

Arguments:

v G:Chart-Vector

Returns:

G:Positive-Chart-Coordinate

Source: #p" /belgica-2g/jam/az/ geometry/ chart-vectors.lisp"

Documentation:Computes the squared L2 norm of <v>.

Usage:(g:chart-vector-12-norm2 v)

Arguments:

v G:Chart-Vector

G:Positive-Chart-Coordinate

Source:

A list

Usage:(typep x 'G:Ch.art:-Vec1~o:r'-List

Page 32: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Accessor function for x coordinate.

Usage:(g:chart-vector-x v)

Arguments:

17- G:Chart-Vector

Returns:

G:Chart-Coordinate

Source: #p" /belgiea-2g/jam/az/geometry/ chart-vectors.lisp"

Documentation:Sets the vector's x coordinate.

Usage:(sett

Source: #p" /belgica-2g/jam/az/ geometry/ chart-vectors.lisp"

Documentation:y cooJrdinate.

Usage:(g:chart-vector-y v)

Arguments:

v-G

Returns:

G:Chart-Coordinate

Page 33: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

32

Source:

Sets the vector's y coordinate.

Usage:(set! (g:chart-veetor-y v) y)

Source: #1''' /belgica.-2g/jam/az/ geometry/chart-vectors.lisp"

Implements Cohen-Sutherland clipping. From Foley and Van<xl>, <y1> of line cnpped to <clipping..rect> if

OU1tsl<le <c:li])ping·rect> note: the direction of the line is maintained (from

Usage:(g:elip-sereen-line xO yO x1 y1 elipping-reet)

Arguments:

xO - G: Screen-CoordinateyO - G: Screen-Coordinatex1 - G:Sereen-Coordinatey1 G:Sereen-C99rd~ate

eli.pping-reet --G:Screen-Reet

Returns:

xO - (Or _ull G:Sereen-Coordinate)yO - (Or lull G:Sereen-Coordinate)x1 (Or lull Screen-Coordinate)y1 (Or lull G:Sereen-Coordinate)

Source:

(g: COl:)v-,c:nart··no:int p tkey

Page 34: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Returns:

result

Source: #p" Ibelgica-2g/jamlazlgeometryI chart-points.lisp"

Documentation:The function for Chart-Reets.

Usage:(g:copy-chart-rect r .tkey result)

Arguments:

r - G:Chart-Rectresult - G:Chart-Rect

Returns:

result

SOUfce:#p"Ibelgica-2g/jamjazjgeometryIchart-rects.lisp"

Documentation:The copier function for Chart-Vectors.

copy-chart-vector v .tkey result)

Arguments:

v

Returns:

result

33

Page 35: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

function for Screen-Points.

Usage:(g:copy-screen-point p "key result)

Arguments:

p G:Sereen-Pointresult - G:Screen-Point

result

Source: #p" fbelgica-2gfjamfazfgeometryfscreen-points.lisp"

Documentation:The copier function for Screen-Reds.

Usage:(g:copy-screen-rect r tkey result)

r - G: Screen-Rectresult G:Screen-Rect

Returns:

Source:

COli)Y-'scre~an-Vejctcfr v tkey rel3ul.t

Page 36: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

v

Returns:

result

Source: #p" Ibelgica-2g/iamlazIgeometryIscreen-vectors.lisp"

Documentation:Mapsfrom Chart to •Screen space.

35

x 'G:Diagonal-C->S-Hap)

Source: #p" Ibelgica-2g/iam/azIgeometryItransforms.lisp"

Documentation:A map between Screen and Chart space, in one direction or the other.

Usage:(typep x 'G:Diagonal-C<->S-Hap)

Documentation:Inverse maps from

Usage:

to Chart space.

Sourqe: #p" Ibelgica-2g/iam/azlgeometry/transforms.lisp"

Usage:(g:distance-to-line p

Page 37: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

ipl G: Chart-Point

Returns:

G:Positive-Chart-Coordinate

Source: #p" /belgica-2g/jarn/az/geometry/ chart-geometry.lisp"

Chart-Points.

US<1g~:

(g:equai-chart-points? pO pi)

Arguments:

pO G:Chart-Pointpi G:Chart-Point

Returns:

(Hember T Iii)

Source: #p" IbeIgica-2g/jamlaz/ geometryIchart-points.lisp"

Documentation:The eqtlah:ty pJredlcate

Usage:(g:equai-ehart-reets? rO rl)

Arguments:

rOr1 - G:'Ch~lIt-R,eet

(HembElr T lil)

Page 38: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

37

Documentation:equality predicate for Chart-Vectors.

Usage:(g:equal-chart-vectors? vO vO

Arguments:

vO - G: Chart-Vectorvl - G:Chart-Vector

(Hember T llil)

Source: #p" fbelgica-2gfjamfazfgeometryfchart-vectors.lisp"

Documentation:The equality predicate for Screen-Pointsd.

Usage:(g:equal-screen-points? pO pl)

Arguments:

pO - G: Screen-Pointpl - G:Screen-Point

Returns:

Source: #p" fbelgica-2gfjamfazfgoometryfscreen-points.lisp"

(g: eQl1al-s(;reen'-re,ctI3? rO rl)

Page 39: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

38

rO - G:f;creeJ;l-R$ctrl - G: Screen-Reet

Returns:

(Member T lil)

Source: #p" IbeIgica-2g1jamlaz1geometry1screen-rects.Iisp"

Documentation:equality predicate for Screen-Vectors.

Usage:(g:equal-screen-vectors? vO vi)

Arguments:

vO - G: Screen-Vectorvi - G:Screen-Vector

Returns:

(Member T lil)

Source:

Documentation:Computes the smallest reet that includes both <r> and <p>. Note that it's ok for <r> to be eq

to <result>.

(g:extend-chart-reet-to-point r· p tkeyresult)

Arguments:

rp - G: Chs.rt--Po:i..D.tresult - Grehart-Reet

Returns:

result

Page 40: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

39

Source:

Documentation:Computes the smallest reet that includes both <rO> and <r1>. Note that it's ok for <rO> and/or

<r1> to be eq to <result>.

Usage:(g:extend-chart-rect-to-rect rO r1 ikey result)

Arguments:

rO G:Chart-Rectr1 G:Chart~Rect

result - G: Chart~Rect

Returns:

result

Source: #p" jbelgica-2gjjamjaz j geometry j chart-geometry.lisp"

Documentation:Computes the smallest reet that includes both <r> and <p>. Note that it's ok for <r> to be eq

to <result>.

Usage:(g:extend-screen-rect-to-point r p tkey result)

Arguments:

r G:Screen-Rect

result - G:Scre.en-Rect

Returns:

result

Source:

Documentation:

Page 41: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

40

that includes <rO> and Note that it's ok for <rO> and/or

Usage:(g:extend-screen-rect-to-rect rO r1 akey ""''''''1111:

Arguments:

rO - G: Screen-Rectr1 G:Screen-Rectresult G:Screen-Rect

Returns:

result

Source: #p" /belgica-2gfjarn/az/geornetry/screen-geometryJisp"

Usage:(in-package :Geometry)

Source: #p" /belgica-2g/jam/az/geometry/package.lisp"

Usage:(g:get-nice-tics min max &key tics)

Arguments:

min

Returns:

G:Tics

<max>.

Source:

Page 42: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

41

Returns the reet that is the intersection. Note that it's ok for <result> to be <rO> or rl>.

Usage:(g:intersect-2-chart-rects rO rl akey result)

Arguments:

rO G:Chart-Rectrl G:Chart-Rectresult G:Chart-Rect

Returns:

result

Source: ,#p" jbelgica-2gjjamjazjgeometry j chart-goometry.lisp"

Documentation:Returns the reet that is the intersection. Note that it's ok for <result> to be <rO> or rl>.

Usage:(g:intersect-2-screen-rects rO rl ikey result)

Arguments:

rO G:Screen-Rectrl - G: Screen-Rectresult -G:Screen-Rect

Returns:

result

Source: ,#p" jbelgica-2gfjamjazjgeometryjscreen-goometry.lisp"

Documentation:Returns the reet that is the intersection. Note that it's ok for <result> to be a member of <rs>.

Usage:intersect-chart-rects rs ikey result)

rs - G:Chart-Rect-Listresult G:Chart-Rect

Page 43: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

42

Returns:

result

Source: #p" Ibelgica-2g/JamlazlgeometryIchart-geometry.lisp"

Documentation:Returns the rect that is the intersection. Note that it's ok for <result> to be a member of <rs>.

Usage:(g:intersect-screen-rects rs &key result)

Arguments:

rs - G: Screen-Rect-Listresult G:Screen-Rect

Returns:

result

Source: #p" jbelgica-2g/jamjazjgeometryjscreen-geometry.lisp"

Documentation:Put the (pseudo) inverse of <map> in <result>.

Usage:(g:inverse map Akey result)

Arguments:

map - G:Diagonal-C<->S-Hapresult - G:Diagonal-C<->S-Hap

Returns:

result

Documentation:

Page 44: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Mc,dllv <smaller>'s pomtlLon so it is within <Ia,re:e:r>. If <smaller> won't fit,

Usage:(g:keep-sereen-rect-in smaller larger)

Arguments:

smaller - G: Screen-Rectlarger G:Screen-Reet

Source: #p" jbelgica-2gjjamjazjgeometryjscreen-geometryJisp"

43

upper left corner

Function

Documentation:Computes a linear combination of <11'0> and <11'1>. Note that it'8 ok for <result> to be eq to either

<11'0> or <11'1> (or both).

Usage:(g:linear-mix-chart-vectors aO 11'0 a1 11'1 tkey result)

Arguments:

aO G:Chart-Coordinate11'0 G:Chart-Vectora1 G:Chart-Coordinate

G:Chart-Veetorresult G:Chart-Vettor

Returns:

result

Source:

Documentation:

<vO> orcombination of <11'0> and <vI>. Note that it's ok for <result> to be eq to either

linear-Illix-sereen-vectors aO 11'0 a1 11'1

Page 45: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

44

aO lumber'1'0a1'1'1 G:Screen-Vectorresult - G:Screen-Vector

Returns:

result

Source: #p" /belgica-2g/jam/az/geometry/screen-vectors.Iisp"

map that unan,-ltieCI; <c> to Screen-Rect <s>.

Usage:(g:make-affine-map-between e s)

Arguments:

e - G: Chart-Reets G:Sereen-Reet

Returns:

G:Diagonal-C->S-Hap

Source: #p" jbelgica-2g/jam/azjgeometry/transforms.Iisp"

<x> and <y> coordinates.

Usage:(g:make-ehart-point l:key x y)

xy

Returns:

Page 46: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

45

G:Chart-Point

Source:

Documentation:The constructor function for Chart-Rect.The Rect is optionally initialized by specifying any two of <:left>, <:right>, and <:width>, and

any two of <:top>, <:bottom>, and <:height>.

Usage:(g:make-chart-rect tkey width right left height bottom top)

Arguments:

width - (Or lull G:Positive-Chart...Coordinate)rigbt - (Or lull G:Chart-Coordinate)left - (Or lull G:Chart-Coordinate)height (Or lull G:Positive-Chart-Coordinate)bottom (Or lull G:Chart-Coordinate)top - (Or lull G:Chart-Coordinate)

Returns:

G:Chart-Rect

Source: #p"/belgica-2gjjamjazlgeometryjchart-rects.lisp"

Documentation:The constructor function for Chart-Vector.The vector is optionally initialized with the given <x> and <y> coordinates.

Usage:(g:make-chart-vector tkey x y)

Arguments:

x - G: Chart-Coordinatey - G:Chart-Coordinate

Returns:

G:Chart-Vector

Page 47: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

46

Source:

Documentation:constructor tUllctJIOn

The point is Opi;lOJlalJly the given <x> and <y> coordinates.

Usage:(g:make-screen-point ~key x y)

Arguments:

x - G: Screen-Coordinatey - G:Screen-Coordinate

Returns:

G:Screen-Point

Source: #p" /belgica-2g/jam/az/ geometry/ screen-points.lisp"

Documentation:The constructor function for Screen-RectoThe Rect is optionally initialized by specifying any two of <:left>, <:right>, and <:width>, and

any two of <:top>, <:bottom>, and <:height>.

Usage:(g:make-screen-rect ~key width right left height bottom top)

Arguments:

width (Or 11111 G:Positive-Screen-Coordinate)ri.ght - (Or lull G:Screen-Coordinate)

- (Or lull G:scl~een-(;oord;i.na.te)

top - (Or lull G: Screen-Coordinate)

Returns:

Page 48: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Documentation:constructor function for Screen-Vector.vector is optionally initialized with the

Usage:(g:make-screen-vector ~key x y)

Arguments:

x - G: Screen-Coordinatey - G:Screen-Coordinate

Returns:

G:Screen-Vector

<x> and <y> coordinates.

47

Source: #p" jbelgica-2gjjamjazjgeometryjscreen-vectors.lisp"

Documentation:Displace a point <p> by adding a vector <dp>. Note that it's ok for <p> to be eq to <result>.

Usage:(g:move-chart-point p dp ~key result)

Arguments:

p - G:Chart-Pointdp - G:Chart-Vectorresult - G: Chart-Point

Returns:

result

Source: #p" jbelgica-2gjjamjazjgeometryjchart-points.lisp"

Documentation:lJIspla,ce a a vector Note that it's ok for <I'> to be eq to <result>.

(g:move-screen-point p dp ~key result)

Arguments:

Page 49: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

result

Source: #p"Ibelgica-2g/jam/azlgeometryIscreen-points.lisp"

Arguments:

result)

r G: Chart-Rectresult G:Chart-Rect

Returns:

result - G:Chart-Rect

Source: #P" Ibelgica-2g/jamlaz/geometryItics.Iisp"

x

Page 50: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

(typep x 'G:Positive-Chart-Coordinate-List)

49

Source:

Documentation:A Chart·Vector whose coordinates are positive; it lies in the upper right quadrant

with Screen-Vectors).

Usage:(typep x 'G:Positive-Chart-Vector)

Source: #p"lbelgica.,2g/jam/az/geometrY/chart.vectors.lisp"

Documentation:A non·negative screen coordinate.

Usage:(typep x 'G:Positive-Screen-Coordinate)

Source: #p" Ibelgica.2g/jamlazlgeometryIscreen.coordinates.lisp"

Documentation:list.ofPositive·Screen·Coordinates.

Usage:(typep x 'G:Positive-Screen-Coordinate-List)

Source: #p" Ibelgicar-2g/jamlazIgeometryIscreen·coordinates.lisp"

contrast

Documentation:A ;::'Cl:eelll·

contrast withcoordinates are po:,itlve, ie., which lies in the lower right quadrant (note

Usage:(typep x 'G:Positive-Screen-Vector)

Documentation:

Page 51: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

50

Usage:(typep x 'G:Positive-Sereen-Veetor-List)

Source:

Fu

Documentation:Return <p> to the resource. This must he done with care, since any further reference to <p> will

he an error.

Usage:(g:return-chart-point p)

Arguments:

p - G: Chart-Point

Returns:

t

Source: #p" jhelgica-2gjjamjazjgeometry jchart-points.lisp"

Documentation:Retnrn a reet to the resource. This must he done with care, since any further reference to the

reet will he an error.

Usagl:!:(g:retnrn-ehart-rect r)

Arguments:

r - G:Chart....Reet

Returns:

t

Documentation:

Page 52: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Return <:v) to the resource. This must bebe an error.

Usage:(g:return-chart-vector v)

Arguments:

v G:Chart-Vector

Returns:

t

51

with care, since any fiu·tn,.)' reference to <v) will

SOl.lrce: .#p"lbelgicar2g/jam/azlgeometryIchart-veetors.lisp"

Documentation:Return <p> to the resource. This must be done with care, since any further reference to <p> will

be an error.

Usage:(g:return-screen-point p)

Arguments:

p - G:Screen-Point

Returns:

t

Source: #p" Ibelgicar2g/jam/az/geometry/screen-points.lisp"

Documentation:J.\NOUJ."" a to the resource. This must be done with care, since any further reference to the

reet an error.

r G:Screen-Rect

Page 53: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

52

Returns:

t

Source:

[)ocurnentation:Return <v> to the resource. This must be done with care, since any further reference to <v> will

be an error.

Usage:(g:return-screen-vector v)

Arguments:

v - G:Screen-Vector

Returns:

t

Source: #p" jbelgica-2gjjarnjaz jgeometry jscreen-vectors.lisp"

[)ocurnentation:The Screen-Coordinate type determines the allowed values for the coordinates of Screen-Vectors,

Screen-Points, and Screen-Rects.

Usage:(typep x 'G:Screen-Coordinate)

Source: #p" jbelgica-2gjjamjazjgeometryj screen-coordinates.lisp"

Documentation:A list of Screen-Coordinates.

Source:

Page 54: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Usage.:(g:screen-distance-to-1ine p 1pO 1p1)

Arguments:

p G:Screen-Point1pO - G:Screen-Point1p1 G:Screen-Point

Returns:

Source: .#p" /belgica-2g/jam/azlgeometry/screen.geometry.lisp"

Documentation:A Screen·Object is one of Screen·Vector, Screen·Point, or Screen·Rect.

Usage:(typep x 'G:Screen-Object)

some abi$tract sense).increaLSe8 from to right, and, unfortunately, like most

Source:

Is <r>?

{g: .screen.-po,int;-i:t:t-rElct? p

Page 55: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

54

p G:Screen-Pointr G:Screen-Rect

Returns:

(Hember T lil)

Source: #p" jbelgica-2gjjamjazjgeometryjscreen-geometry.lisp"

Documentation:A list of Screen-Points.

Usage:(typep x 'G:Screen-Point-List)

Source: #p" jbelgica-2gjjamjazjgeometryjscreen-points.lisp"

Documentation:Accessor function for x coordinate.

Usage:(g:screen-poi1j.t..x p)

Arguments:

p - G: Screen-Point

Returns:

G:Screen..Coordinate

Source:

x coclrdlnat,e.

Source:

Page 56: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

y

aC'Ce8lSOf fUIlctJtOn for y coordinate.

Usage:(g:screen-point-y p)

Arguments:

p - G: Screen-Point

Returns:

G:Screen-Coordinate

Documentation:Sets the point's y coordinate.

Usage:(setf (g:screen-point-y p) y)

Source: #p" jbelgica-2gfjamjaz jgeometry jsereen-points.lisp"

Are all the points in the list <ps> in the reet <r>?

Usage:(g:screen-points-in-rect? ps r)

P$ - G: SClt'eEln-Pojlnt.-L'istr - G:Screen-Rect

(HelllbElr T

Page 57: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

gen,eral specifil~ations ofwe

non-Ileg:atlve. Zero width and are taken to an emptyand height of 1 means the Screen-Red covers one pixeL Empty screen-reds

Usage:(typep x

Documentation:"Bottom" is an alias for "ymax".

Usage:(g:screen-rect-bottom r)

Arguments:

r - G: Screen-Rect

G:Screen-Coordinate

Source:

int,erpretl~d as a transbttion.

ltelmrllS the sm;aUest reet contairling all a list.

Page 58: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

51

Usage:(g:screen-rect-covering-points ps ike, result)

Arguments:

ps - G: Screen-Point-Listresult - G:Screen-iect

Returns:

result

Source: #p"Ibelgica.-2g/jarnlazlgeometryIscreen-geometry.lisp"

Documentation:Returns the smallest reet containing all reets in a list.

Usage:(g:screen-rect-covering-rects rs ikey result)

Arguments:

rs G:Screen-iect-Listresult - G:Screen-iect

Returns:

result

Source: #p"Ibelgica.-2g/jarnlazlgeometry/screen-geometry.lisp"

Documentation:extent is the vector from upper to the lower right.

The extent of a reet is a vector whose coordinates are its width and The of areet is a corner point. we use is determined coordinate u.1 "V"... and thedesire to have sum of extent corner of reet.

the is corner; for it's corner.

screen-rect-extent r ikey TA's1l1~

Page 59: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

58

rresult

Returns:

result

G:Screen-Vector

Source: #p" Ibelgica-2g/jamlazlgeometryIscreen-rects.lisp"

Documentation:Changing the extent of a red is interpreted as a scaling.

(setf (g:screen-rect-extent r) v)

Source: #p" Ibelgica-2g1jamlazIgeometryIscreen-rects.lisp"

Documentation:The height of <r>.

Usage:(g:screen-rect-height r)

Arguments:

r G:Screen-Rect

Returns:

G:Positive-Screen-Coordinate

Source:

or

Page 60: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Documentation:Returns y coordinate of the bottom most pixel inside <r>.

Usage:(g:screen-rect-inner-bottom r)

Arguments:

r - G: Screen-Rect

Returns:

G:Screen-Coordinate

Source: #p" jhelgica--2gfjamjaz jgeometryjscreen-rects.lisp"

Documentation:Changing any of the border coordinates of a reet is interpreted as a translation.

Usage:(sett (g:screen-rect-inner-bottom r) y)

Source: #p" jbelgica--2gjjamjazjgeometryjscreen-reets.lisp"

Documentation:

Returns the x coordinate of the left most pixel inside <r>.

Usage:(g:screen-rect-inner-lett r)

Arguments:

r G:Screen-Rect

Returns:

G:Screen-Coordinate

59

Page 61: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

60

Ub;ang;ing any coordinates of a rect is intel'I)rel~ed as a translation.

Usage:(setf (g:screen-rect-inner-left r) x)

Source: #p" fbelgica-2gfjamfazfgeometryfscreen-recta.lisp"

Documentation:Returns the x coordinate of the right most pixel inside <1'>.

Usage:(g:screen-rect-inner-right r)

Arguments:

r - G:Screen-Rect

Returns:

G:Screen-Coordinate

Source: #p" fbelgica-2gfjamfazfgeometryfscreen-rects.lisp"

Documentation:Changing any of the border coordinates ofa rect is interpreted as a translation.

Usage:(setf (g:screen-rect-inner-right r) x)

Source: #p"fbelgica-2gfjamfazfgeometry!screen-rects.Iisp"

Documentation:Returns the y coordinate of the

Usage:(g: SCl:'eell-r,ect-illtnel,-t,:'>p r)

most inside <1'>.

r

Returns:

G:Screen-Rect

Page 62: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

G:Screen-Coordinate

Source:

Documentation:Changing any of the border coordinates of a reet is interpreted as a translation.

Usage:(setf (g:screen-rect-inner-top r) y)

Source: #p" Ibelgica-2gfjam/az/geometryIscreen-reets.lisp"

Documentation:Test whether two reets intersect.

Usage:(g:screen-rect-intersect? rO r1)

Arguments:

rO - G:Screen-Rectr1 - G: Screen-Rect

Returns:

(Heatber T lil)

Source: #p" Ibelgica-2g/jamlazIgeometryIscreen-geometry.lisp"

Usage:(g:screen-rect-left r)

Arguments:

r G:Screen-Rect

Returns:

G:Screen-Coordinate

Page 63: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

62

Source:

Documentation:Changing any of the border coordinates of a rect is interpreted as a translation.

Usage:(setf (g:screen-rect-left r) x)

Source: #p" Ibelgica-2g1jamlaz1geometry1screen-rects.lisp"

Documentation:A Screen-Rects.

Usage:(typep x 'G:Screen-Rect-List)

Source: #p" Ibelgica-2g/jamlazlgeometryIscreen-rects.lisp"

Documentation:The L2 distance between the closest two points of the two rects.

Usage:(g:screen-rect-min-12-dist rO r1)

Arguments:

rO G:Screen-Rectrl - G: Screen-Rect

Returns:

G:Positive~Chart-Coordinate

Source: #p" Ibelgica-2gfjamlazlgeometry1screen-geometry.lisp"

Documentation:The L2 distance (sqlua,re<i) between the

(g:screen-rect-min-12-dist2 rO rl)

Arguments:

two of the two reds.

Page 64: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

rOr1 - G: ~)CreeIl-B.ect

Returns:

G:Positive-Screen-Coordinate

Source: #p" jbelgica-2gjjamjazjgeometryjscreen-geometry.lisp"

Documentation:

Usage:(g:screen-rect-origin r ~key result)

Arguments:

r - G: Screen-Rectresult - G:Screen-Point

Returns:

Source: #p" jbelgica-2gjjamjazIgeometry j screen-rects.lisp"

Usage:(g:screen-rect-origin r) p)

a trallsl~Ltioll.

Source:

Returns the y coordinate of the first outside <r> the bottom.

Page 65: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

64

(g:screen-rect-outer-bottom r)

Arguments:

r G:Screen-Rect

Returns:

G:Screen-Coordinate

Source: #p" jbelgicar-2gjJamjazjgeometryjscreen-rects.lisp"

Documentation:Changing any of the border coordinates of a reet is interpreted as a translation.

Usage:(setf (g:screen-rect-outer-bottom r) y)

Source: #p" jbelgicar-2gjJamjaz j geometry j screen-reets.lisp"

Documentation:Returns the x coordinate of the first pixel outside <r> on the left.

Usage:(g:screen-reCt-outer-left r)

Arguments:

r G: Screen-Rect

Returns:

G:Screen-Coordinate

Source:

of the border coordinates of reet is mterj:,rel:ed as a translation.

Usage:(g:screen-rect-outer-left

Page 66: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

x coordinate of the first pixel outside <r> on the right.

Usage:(g:screen-rect-outer-right r)

Arguments:

r G:Screen-Rect

G:Screen-Coordinate

Source: #p" jbelgica-2gjjamjazjgeometryjscreen-rects.lisp"

Documentation:Changing any of the border coordinates of a reet is interpreted as a translation.

Usage:

65

Source: #p" jbelgica-2gjjamjazjgeometryjsereen-rects.lisp"

ltetUlms the y coordinate OU1GSldle <r> on the top.

Usage:(g:screen-rect-outer-top r)

Arguments:

r

Returns:

G:Screen-Coordinate

Page 67: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

66

Utllan.glIllg any of the border coordinates of a rect is intefJ)rej~ed as a translation.

Usage:(setf (g:screen-rect-outer-top r) y)

Source: #p" Ibelgica-2g/jamlazIgeometryIscreen-rects.Iisp"

Usage:(g:screen...rect-right r)

Arguments:

r G:Screen-Rect

Returns:

G:Screen-Coordinate

Documentation:Changing any of the border coordinates of a rect is interpreted asa translation.

Source:

an alias for "'r>~;V'"

Page 68: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

r G:Sereen-Reet

Returns:

G:Sereen-Coordinate

Source: #p" Ibelgica-2gjjamjazlgeometryIscreen-rectsJisp"

Documentation:Changing any of the border coordinates of a rect is interpreted as a translation.

Usage:(setf (g:sereen-reet-top r) y}

Source: #p" Ibelgica-2gjjamlazlgeometryIscreen-rectsJisp"

Documentation:The width of <r>.

Usage:(g:sereen-reet-width r)

Arguments:

r - G: Screen-Rect

Returns:

G:Positive-Screen-Coordinate

Source: #p" Ibelgica-2g/jam/azlgeometryIscreen-reets.lisp"

67

Documentation:Ch.anging a reet's width or

Usage:(setf (g:screen-rect-width

Page 69: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

68

side of <r>.

Usage:screen-rect-max

Arguments:

r - G:Screen-Rect

Returns:

G:Screen-Coordinate

Source:

Changing any of the border coordinates of a reet is interpreted as a translation.

Usage:(setf (g:screen-rect-xmax r) x)

Source: #p" /belgica-2g/jam/az/geometry/sereen-rects.lisp"

of <r>.

Usage:(g:screen-rect-min r)

Arguments:

Returns:

G:Screen-Coordinate

Documentation:Gban:ging any of the border COlJrc!ma,t€~ of a reet is intelI>relGed as a translation.

Page 70: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Usage:(setf (g:screen-rect-xmin r) x)

69

Source:

Documentation:The bottom of <r>.

Usage:(g:screen-rect-ymax r)

Arguments:

r - G:Screen-Rect

Returns:

G:Screen-Coordinate

Source: #p" jbelgica-2gfjamjazjgeometryjscreen-rects.lisp"

Documentation:Changing any of the border coordinates of a rect is interpreted as a translation.

Usage:(setf (g:screen-rect-ymax r) y)

Source: #p" fbelgica-2gjjamjazjgeometryjscreen-rects.lisp"

Documentation:The top of <r>.

Usage:(g:screen-rect-ymin r)

Arguments:

r G:Screen-Rect

Returns:

G:Screen-Coordinate

Page 71: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

cOI:>rcli:tlatt::s of a reet is mt,erJ>relLed as a translation.

(g:screen-rect-ymin y)

Source:

Stru

Usage:(typep x 'G:Screen~Vector)

Source: #p" Ibelgica.-2g/jamlazIgeometryIscreen-vectors.lisp"

(g:screen-vector-11-norm v)

Arguments:

v - G:Screen-Vector

Comp,utl~ the L2 norm of <v>.

Page 72: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Arguments:

v G:Screen-Vector

Returns:

G:Positive-Chart-Coordinate

Source: #p" Ibelgica-2g/jam/az/geometryIscreen-vectors.lisp"

71

of <v>.

Usage:(g:screen"'vector-12-norm2 v)

Arguments:

v G:Screen-Vector

Returns:

G:Positive-Screen-Coordinate

Source:

Documentation:A list of Screen-Vectors.

Usage:

Source:

screen-veetor-x

Page 73: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

v

Returns:

G:Screen-Coordinate

Source:

Documentation:Sets the vector's x coordinate.

Documentation:Accessor function for y coordinate.

Usage:(g:screen-vector-y v)

Arguments:

v - G:Screen-Vector

Returns:

G:Screen-Coordinate

Source:

Documentation:

Page 74: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Documentation:Test if <smaller> is inside <larger>.

Usage:(g:sub-chart-rect? smaller larger)

Arguments:

smaller G:Chart-Rectlarger - G: Chart-Rect

Returns:

(Kember T lil)

Source: #p" jbelgica-2gjjamjaz jgeometry jchart-geometry.lisp"

Documentation:Test if <smaller> is inside <larger>.

Usage:(g:sub-screen-rect? smaller larger)

Arguments:

smaller G:Screen-Rectlarger - G: Screen-Reet

Returns:

(Kember T lil)

Source: #p" jbelgica-2gjjamjazjgeometryjscreen-geometry.lisp"

73

COmI=~utles the difference vector of Note that it's ok for or to be eq to

(g: sub,tn.ct·-chart:-p<:>in1t;s pO

Arguments:

tlter

Page 75: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

74

pO G:Chart-Pointp1 - G: Chart-Pointresult - G:Chart-Vector

Returns:

result

Source: #p" Ibelgica-2gfjamjaz1geometry1chart-points.lisp"

Documentation:Subtract <vi> from <vO>. Note that it's ok for <result> to be eq to either <vO> or <vi> (or both).

Usage:(g:subtract-chart-vectors vO v1 !key result)

Arguments:

vO - G:Chart-Vectorv1 - G:Chart-Vectorresult G:Chart-Vector

Returns:

result

Source: #p" Ibelgica-2g1jamlaz1geometry1chart-veetors.lisp"

Documentation:Computes the difference

<result>.

Usage:(g:subtract-screen-points pO p1 !key result)

Arguments:

pO G:Screen-Pointp1 G:Screen-Pointresult G:Screen-Vector

Returns:

Page 76: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Source: #p" jbelgica-2gfjamjazjgeometryjscreen-veetors.lisp"

Documentation:

Returns:

result

result

Usage:(g:subtract-screen-vectors vO v1 iker result)

Documentation:Subtract <vi> from <yO>. Note that it's ok for <result> to be eq to either <vO> or <vi> (or both).

Arguments:

Source:

mcrernellt between tics.

Usage:(g:tic-inc tics)

Arguments:

tics G:Tics

Usage:(g:tic-labels

Page 77: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

76

tics G:Tics

Returns:

(List String)

Source: #p" /belgica-2gfjam/az/geometry/tics.lisp"

Documentation:Returns the length of the interval covered by the tics.

Usage:(g:tic-length ti)

Arguments:

ti G:Tics

Returns:

G:Positive-Chart-Coordinate

Source: #p" /belgica-2g/jam/az/geometry/tics.lisp"

Documentation:The valueofthe maximum tic mark.

Usage:(g:tic-max tics)

Arguments:

G:Tics

Source: #p" /belgica-2g/jam/az/geometry/tics.lisp"

minimum tic mark.

(g:tic-min

Page 78: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

tics G:Tics

77

Source:

Documentation:The number of tics.

Usage:(g:tic-n tics)

Arguments:

tics - G:Tics

Returns:

G::Positive-Fixnum

Source: #p" fbelgica-2gfjamfazfgeometryjticsJisp"

Documentation:Returns a list of the values of the tic marks.

Usage:(g:tic-values

Arguments:

tics - G:Tics

G:Chart-Coordinate-List

Source:

A strttcture dle8CribiIlg the placen:tent

x 'G:

tic marks on a chart.

Page 79: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

78

Source:

Documentation:Apply <map> to <x> and put the answer in <result>.

Usage:(g:transform map x tkey result)

Arguments:

map G:Diagonal-C<->S-Hapx - (Or G:Chart-Opject G:Scnen-Object)result (Or G:Chart-Object G:Screen-Object)

Returns:

result

Source: #p" jbelgica.-2gjjamjazjgeometryjtransforms.lisp"

Documentation:This macro binds <vname> to a point borrowed from the resource, optionally initialized to the

supplied <x> and <y> coordinates, and returns the point to the resource on exit. The user shouldbe careful not to create the dynamic extent of the macro body.

Usage:(g:with-borrowed-chart-point (vname tkey (x O.OdO) (y O.OdO» tbody body)

Source: #p" jbelgica-2gjjamjaz j geometry j chart-points.lisp"

macro <vname> to a resource, optionally byany two of <:left>, <:right>, and and any two of <:bottom>, <:height>,

retufI1S the reet on user should not to create references tothat survive extent of the macro

nil) (height (bott,

Page 80: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

Documentation:

macro <vname> to aSUliplled <x> and and returns the tohe careful not to create references to the vector that survive

79

option:ally initialized to theresource on user should

dYltlatnic extent of the macro hody.

Usage:

(g;with-borrowed-chart-vector (vname Akey (x O.OdO) (y O.OdO» Abody body)

Source: #p" jhelgica-2gjJamjaz j geometry j chart-vectors.lisp"

Documentation:

This macro hinds <VIlanle>supplied <x> and <y> ooclrdi.nal~es,

he careful not to create ref.erencElS

Usage:

(g;with-borrowed-screen-point

resource, optionally initialized to theres:ource on exit. user should

dYJlatnic extent of the macro body_

(vname Akey (x 0) (y 0» Abody body)

Source: #p" jhelgica-2gfjamjaz j geometry j screen-points.lisp"

Documentation:

This macro hinds <vname> to a rect horrowed from the resource, optionally initialized hy spec­of <:t()p>, <:hottom>, and <:height>,he careful not to create references to

Usage:

(g:with-borrowed-screen-rect (vname Akey (width nil) (right nil) (left nil) (height nil) (bot-

Source: #p" jhelgica-2gjJanljazjgeometryjscreen-rects.lisp"

Documentation:

macro hinds <vuaJrne:> to a vector borro:wed from the resource, optIOnally initializEldSUl}plled <x> and and returns to resource onhe careful not to create to the vector extent of

) Abody

Page 81: GEOMETRY: A PACKAGE FOR BASIC GEOMETRIC CALCULATION IN COMMON LISP… · 2017-09-01 · Geometry: a package for basic geometric calculation in Common Lisp, release 1.0 JOHN ALAN McDoNALD

ACM SIGGR.A.I

References

D. lJefl:Dse.Tutorial "JU'U">G

[2] A to goo,mettlc progralrnming. In W. Str:a.ss€rr, editor,Theoru and Practice of Geometric Modeling. Vedag, 1989.

[3] Tony D. DeRose. A coordinate-free apI>ro'Cl.ch to (a algehraand its implementation). Technical Dept. of Computer Science, U. of Washington, 1989.course notes for CSC1557, Spring 1989.

[4] J.J. Dongarra, C.B. Moler, J.R. Bunch, and G.W. Stewart. UNPACK Users' Guide. SIAM,Philiadelphia, 1979.

Computtir ::iCJe'nce and Statistics: Proc. 20th;aS~-~HL V\Tasblington, 1988. ASA.

[6] Ob,jecllr-Oliented prc)gr,tmJrnirlg for linear algehra. SIGPLAN IVOLZC,~S

[7] John Alan McDonald. Definitions: a simple datahase for typesetting documentation. Technicalreport, Dept. of Statistics, U. of Washington, 1991.

[8] John Alan McDonald and Jan O. Pedersen. A case study in statistical computing in a lispenvironment: Geometric ahstractions for constrained optimization of layouts. In Proc. of the1989 Joint Statistical Meetings, Stat. Compo Sect., 1989.

[9] John Alan McDonald and Michael Sannella. Arizona overview and notes for release 1.0. Tech­nical report, Dept. of Statistics, U. of Washington, 1991.

[11] John Alan McDonald and Michael Sannella. Chart: a simple Common Lisp package for plottingdata 0.0. Technic(l,'lreport, Dept. of Statistics, U. of Washington, 1991.

a portahle bitma~p )?;ltapJillcs pa€:ka~~e forof Statistics,

Herkele,y, 1989.Geometric Gomput~~tio'ns. PhD

G.L. Steele. second CUl!,IV;l1, 1990.


Recommended