-
+
Data Types
A rich set of functions and operators is available to perform various geometric
- operations such as scaling, translation, rotation, and determining
+ operations such as scaling, translation, rotation, and determining
intersections. They are explained in .
- Points are the fundamental two-dimensional building block for geometric types.
- Values of type point are specified using the following syntax:
+ Points are the fundamental two-dimensional building block for geometric
+ types. Values of type point are specified using either of
+ the following syntaxes:
( x , y )
where x> and y> are the respective
coordinates, as floating-point numbers.
+
+ Points are output using the first syntax.
+
Line segments (lseg) are represented by pairs of points.
- Values of type lseg are specified using the following syntax:
+ Values of type lseg are specified using any of the following
+ syntaxes:
+[ ( x1 , y1 ) , ( x2 , y2 ) ]
( ( x1 , y1 ) , ( x2 , y2 ) )
- ( x1 , y1 ) , ( x2 , y2 )
+ ( x1 , y1 ) , ( x2 , y2 )
x1 , y1 , x2 , y2
(x2,y2)
are the end points of the line segment.
+
+ Line segments are output using the first syntax.
+
Boxes are represented by pairs of points that are opposite
corners of the box.
- Values of type box are specified using the following syntax:
+ Values of type box are specified using any of the following
+ syntaxes:
( ( x1 , y1 ) , ( x2 , y2 ) )
- ( x1 , y1 ) , ( x2 , y2 )
+ ( x1 , y1 ) , ( x2 , y2 )
x1 , y1 , x2 , y2
- Boxes are output using the first syntax.
+ Boxes are output using the second syntax.
+
+
Any two opposite corners can be supplied on input, but the values
will be reordered as needed to store the
- upper right and lower left corners.
+ upper right and lower left corners, in that order.
- Values of type path are specified using the following syntax:
+ Values of type path are specified using any of the following
+ syntaxes:
-( ( x1 , y1 ) , ... , ( xn , yn ) )
[ ( x1 , y1 ) , ... , ( xn , yn ) ]
- ( x1 , y1 ) , ... , ( xn , yn )
- ( x1 , y1 , ... , xn , yn )
- x1 , y1 , ... , xn , yn
+( ( x1 , y1 ) , ... , ( xn , yn ) )
+ ( x1 , y1 ) , ... , ( xn , yn )
+ ( x1 , y1 , ... , xn , yn )
+ x1 , y1 , ... , xn , yn
where the points are the end points of the line segments
comprising the path. Square brackets ([]>) indicate
an open path, while parentheses (()>) indicate a
- closed path.
+ closed path. When the outermost parentheses are omitted, as
+ in the third through fifth syntaxes, a closed path is assumed.
Polygons are represented by lists of points (the vertexes of the
polygon). Polygons are very similar to closed paths, but are
- stored differently
- and have their own set of support routines.
+ stored differently and have their own set of support routines.
- Values of type polygon are specified using the following syntax:
+ Values of type polygon are specified using any of the
+ following syntaxes:
( ( x1 , y1 ) , ... , ( xn , yn ) )
- ( x1 , y1 ) , ... , ( xn , yn )
- ( x1 , y1 , ... , xn , yn )
- x1 , y1 , ... , xn , yn
+ ( x1 , y1 ) , ... , ( xn , yn )
+ ( x1 , y1 , ... , xn , yn )
+ x1 , y1 , ... , xn , yn
where the points are the end points of the line segments
Circles are represented by a center point and radius.
- Values of type circle are specified using the following syntax:
+ Values of type circle are specified using any of the
+ following syntaxes:
< ( x , y ) , r >
( ( x , y ) , r )
- ( x , y ) , r
- x , y , r
+ ( x , y ) , r
+ x , y , r
where
- (x,y)
- is the center point and r is the radius of the circle.
+ (x,y)>
+ is the center point and r is the radius of the
+ circle.