Class new title: ↪Point
subclassof: Object
fields: 'x y'
declare: ''
≤ t1
[⇑x ≤ t1 x and⦂ y ≤ t1 y]
≥ t1
[⇑x ≥ t1 x and⦂ y ≥ t1 y]
* t1
[⇑Point new x: x * t1 asPtX y: y * t1 asPtY]
+ t1
[⇑Point new x: x + t1 asPtX y: y + t1 asPtY]
- t1
[⇑Point new x: x - t1 asPtX y: y - t1 asPtY]
/ t1
[⇑Point new x: x / t1 asPtX y: y / t1 asPtY]
< t1
[⇑x < t1 x and⦂ y < t1 y]
= t1
[⇑x = t1 x and⦂ y = t1 y]
> t1
[⇑x > t1 x and⦂ y > t1 y]
abs
[⇑Point new x: x abs y: y abs]
asPoint
asPtX [⇑x]
asPtY [⇑y]
asRectCorner
asRectOrigin
asRectangle
[⇑self rect: self]
copy
[⇑x ⌾ y]
corner
[⇑self + (1 ⌾ 1)]
dist: t1 | t2
[t2 ← (t1 - self) abs.
⇑t2 x + t2 y]
extent
[⇑1 ⌾ 1]
extent: t1
[⇑Rectangle new origin: self extent: t1]
fromPress: t1 value: t2
[x ← t2 nextword.
y ← t2 nextword]
height
[⇑1]
hideData: t1 | t2 t3
[t2 ← String new: 4.
t3 ← Stream new.
t3 of: t2.
t3 nextPoint← self.
⇑t2]
hidePress: t1 complete: t2
[t1 skipcode: self pressCode data: (self hideData: t2)]
length
[⇑(x asFloat * x asFloat + (y asFloat * y asFloat)) sqrt]
max: t1
[⇑Point new x: (x max: t1 x) y: (y max: t1 y)]
min: t1
[⇑Point new x: (x min: t1 x) y: (y min: t1 y)]
normal | t1
[t1 ← y asFloat neg ⌾ x asFloat.
⇑t1 / t1 length]
normalize
[self x← 0.
self y← 0]
origin
pressCode
[⇑7]
printon: t1
[t1 print: x.
t1 append: '⌾'.
t1 print: y]
rect: t1
[⇑Rectangle new origin: self corner: t1]
theta | t1 t2
[x = 0 ⇒
[y ≥ 0 ⇒ [⇑90.0]
⇑270.0]
t1 ← y asFloat / x asFloat.
t2 ← t1 arctan.
x ≥ 0 ⇒
[y ≥ 0 ⇒ [⇑t2]
⇑360.0 + t2]
⇑180.0 + t2]
translate: t1
[x ← x + t1 x.
y ← y + t1 y]
width
[⇑1]
x [⇑x]
x: t1 y: t2
[x ← t1.
y ← t2]
x← t1
[x ← t1]
y [⇑y]
y← t1
[y ← t1]
| t1
[⇑Point new x: x | t1 y: y | t1]