30 lines
759 B
Plaintext
30 lines
759 B
Plaintext
{ (define LIBNAME "A Geometry Library (HtDC)")
|
|
(include "head.tinc") }
|
|
|
|
<p>Add
|
|
<pre><code>
|
|
import geometry.*
|
|
</code></pre>
|
|
at the top of your Definitions Window to import this library.
|
|
</p>
|
|
|
|
<p>This <code>geometry</code> package provides a class for representing
|
|
positions in a Cartesian world:
|
|
<pre>
|
|
<code>
|
|
+----------+
|
|
| Posn |
|
|
+----------+
|
|
| int x |
|
|
| int y |
|
|
+----------+
|
|
</code>
|
|
</pre>
|
|
</p>
|
|
|
|
<p>To create an instance of the <code>Posn</code> class, a program must supply
|
|
two <code>int</code> values: one for its x coordinate of the canvas and the
|
|
second for its y coordinate. </p>
|
|
|
|
{(include "foot.tinc")}
|