Skip to content

Commit 157bdc0

Browse files
Classified the method - complex numbers can be formed from polar coordinates and this is worth making explicit.
1 parent 4f72330 commit 157bdc0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Math-Complex/PMComplex.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ PMComplex >> arcTan: denominator [
390390
res]
391391
]
392392

393-
{ #category : #arithmetic }
393+
{ #category : #'polar coordinates' }
394394
PMComplex >> arg [
395395
"Answer the argument of the receiver."
396396

src/Math-Complex/PMComplex.extension.st

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ PMComplex >> productWithVector: aVector [
1717
^ aVector collect: [ :each | each * self ]
1818
]
1919

20-
{ #category : #'*Math-Complex' }
21-
PMComplex >> random [
22-
"analog to Number>>random. However, the only bound is that the abs of the produced complex is less than the length of the receive. The receiver effectively defines a disc within which the random element can be produced."
23-
^ self class random * self
24-
25-
]
26-
2720
{ #category : #'*Math-Complex' }
2821
PMComplex class >> random [
2922
"Answers a random number with abs between 0 and 1."
3023

3124
^ self abs: 1.0 random arg: 2 * Float pi random
3225
]
3326

27+
{ #category : #'*Math-Complex' }
28+
PMComplex >> random [
29+
"analog to Number>>random. However, the only bound is that the abs of the produced complex is less than the length of the receive. The receiver effectively defines a disc within which the random element can be produced."
30+
^ self class random * self
31+
32+
]
33+
3434
{ #category : #'*Math-Complex' }
3535
PMComplex >> subtractToPolynomial: aPolynomial [
3636
^ aPolynomial addNumber: self negated

0 commit comments

Comments
 (0)