The remaining methods are straightforward:
| Name | Description |
|---|---|
| XCoord( p ) YCoord( p ) RPolar( p ) TPolar( p ) |
Projectors for the: x-coordinate, y-coordinate, distance from origin, angle from origin |
| Dist( p1, p2 ) | Distance between p1 and p2 |
| Displace( p1, delta ) | Displace p1 by delta |
| Direction( p1, p2 ) | Direction from p1 to p2 |
| SetPoint( p, x, y ) | Set p to (x,y) |
| SetPoint2( p, p1 ) | Set p to be the same as p1 |
The examples themselves:
| Specification | Point.h |
| Implementation | Point.c |
The observant among you will have noted some required
features, such as pre-conditions, missing!
This has been a consequence of rushing this example to the
market-place and is not an excuse for omitting them yourselves!