temp _ GeomFigure new a GeomFigure temp at: 5@1 5@1 temp2 _ GeomFigure at: 3 a GeomFigure temp2 location + temp location temp3 _ temp location + temp2 location 8@4 temp2 at: temp3 + 9 + temp location 22@14
Just to list all the methods to add:
Number class - asTriple
Point class - @, asTriple
Triple class - class method x: y: z:, setX: setY: setZ:, printOn:,
storeOn:, z, z:, min:, max:, rounded, @, asPoint, asTriple, +, -
One final important note. You can see how inheritance works since
printOn:, min:, @, and other methods will work even if you don't do
them in the Triple class but they don't return the desired result.
Example code here
n1 _ 3. 3 n1 asTriple. 3@3@3 p1 _ Point x: 1 y: 2. 1@2 p1 @ 3. 1@2@3 p1 asTriple. 1@2@0 t1 _ Triple new. nil@nil@nil t1 setX: 5 setY: 7 setZ: 11. 5@7@11 t2 _ Triple x:1 y:13 z:3. 1@13@3 t2 z. 3 t2 z: 6. 1@13@6 t1 min: t2. 1@7@6 t1 max: t2. 5@13@11 t3 _ 9.7 @ 3.1 @ 7.4. 9.7@3.1@7.4 t4 _ Triple x: 1.2 y:(2.3@4.3) z: (2@3@8.7). 1.2@2.3@4.3@2@3@8.7 t4 rounded. 1@2@4@2@3@9 t1 asPoint. 5@7 t1 asTriple. 5@7@11 t4 asPoint. 1.2@2.3@4.3 t4 asTriple. 1.2@2.3@4.3@2@3@8.7 t1 @ 2. "error in a window - This message is not appropriate for this object" t1 + n1. 8@10@14 t1 + p1. 6@9@11 t1 + t2. 6@20@17 t1 - n1. 2@4@8 t1 - p1. 4@5@11 t1 - t2. 4@-6@5