Point
In Smalltalk, Points are commonly written as "A@B", where A and B are numbers.
Note:
This proves to be a convenient denotation because it also evaluates to a Point instance.
Smalltalk conforms to the usual convention in plane geometry in that the first, or x-coordinate of a Point represents the horizontal dimension, and the second or y-coordinate represents the vertical dimension.
Note:
A CLDT convention is that the point 0@0 (the origin) is in the upper left corner of the screen. The x-coordinate increases as a Point moves to the right, and the y-coordinate increases as it moves down. In some cases this does not conform to the usual conventions for the platform GUI (for example, in OS/2 Presentation Manager the origin is the lower left corner). CLDT imposes a uniform definition of origin to facilitate portability.
Accessing
x, x:, y, y:
Arithmetic
*, +, -, /, //, abs, negated
Porting tip:
The arithmetic messages quo:, rem:, and \\ are defined in Objectworks\Smalltalk, but they are not specified by the Blue Book, and have not been included in VA Smalltalk.
Creating instances
x:y:
Magnitude comparing
<, <=, =, >, >=, between:and:, max:, min:
Point functions
dotProduct:, dist:, normal, transpose
Note:
While not often used, these messages have been included because they are defined in the Blue Book. Objectworks\Smalltalk provides an even more extensive library of such functions, and support for polar coordinates, presumably to support complex computational geometry algorithms. Given the tendency in modern systems to use platform graphics routines, or even graphics processors, these functions have not been included in CLDT.
Porting tip:
Smalltalk/V does not support dist: or normal.
Creating rectangles
corner:, extent:
Truncating and Rounding
rounded, truncated, truncatedGrid:, truncateTo:
Porting tip:
Smalltalk/V does not support truncatedGrid: or truncateTo:.
Last modified date: 04/20/2020