5 ^super.newCopyArgs(x, y);
8 ^Rect.fromPoints(this, aPoint)
11 set { arg argX=0, argY=0; x = argX; y = argY; }
14 asComplex { ^Complex.new(x,y) }
15 asPolar { ^Polar.new(this.rho, this.theta) }
17 asRect { ^Rect.new(0,0,x,y) }
18 asArray { ^[this.x, this.y] }
21 ^this.compareObject(aPoint, #[\x, \y])
24 ^this.instVarHash(#[\x, \y])
26 performBinaryOpOnSomething { |aSelector, thing, adverb|
27 ^thing.asPoint.perform(aSelector, this, adverb)
31 deltaPoint = delta.asPoint;
32 ^(this.x + deltaPoint.x) @ (this.y + deltaPoint.y)
36 deltaPoint = delta.asPoint;
37 ^(this.x - deltaPoint.x) @ (this.y - deltaPoint.y)
42 scalePoint = scale.asPoint;
43 ^(this.x * scalePoint.x) @ (this.y * scalePoint.y)
47 scalePoint = scale.asPoint;
48 ^(this.x / scalePoint.x) @ (this.y / scalePoint.y)
52 scalePoint = scale.asPoint;
53 ^(this.x div: scalePoint.x) @ (this.y div: scalePoint.y)
55 translate { arg delta;
56 ^(this.x + delta.x) @ (this.y + delta.y)
59 ^(this.x * scale.x) @ (this.y * scale.y)
61 rotate { arg angle; // in radians
65 ^((x * cosr) - (y * sinr)) @ ((y * cosr) + (x * sinr))
68 abs { ^x.abs @ y.abs }
71 theta { ^atan2(y, x) }
74 aPoint = aPoint.asPoint;
75 ^hypot(x - aPoint.x, y - aPoint.y)
80 quant = quant.asPoint;
81 ^x.round(quant.x) @ y.round(quant.y)
84 quant = quant.asPoint;
85 ^x.trunc(quant.x) @ y.trunc(quant.y)
90 thatPoint = that.asPoint;
91 ^(this.x mod: thatPoint.x) @ (this.y mod: thatPoint.y)
95 stream << this.class.name << "( " << x << ", " << y << " )";
104 ^super.new(Signal.new(n), Signal.new(n))
119 //Polygon : PointArray
123 //ZigZag : PointArray