File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -657,6 +657,11 @@ PMComplexNumberTest >> testRaisedToInteger [
657657
658658{ #category : #' testing - mathematical functions' }
659659PMComplexNumberTest >> testRaisedToNegativeInteger [
660+ "
661+ Suppose z = cos(pi / 3) + i sin(pi / 3). By De Moivre's theorem, z**-3 is
662+ z ** 3 = cos(-3 pi / 3) + i sin(-3 pi / 3) = cos(-pi) + sin(pi) = cos(pi) - i sin(pi)
663+ z ** 3 = 0 - i
664+ "
660665 | z |
661666 z := (1 / 2 ) + (3 sqrt / 2 ) i.
662667 self assert: (z raisedTo: - 3 ) closeTo: (- 1 + 0 i).
@@ -665,6 +670,10 @@ PMComplexNumberTest >> testRaisedToNegativeInteger [
665670{ #category : #' testing - mathematical functions' }
666671PMComplexNumberTest >> testRaisedToPositiveInteger [
667672 | z zCubed |
673+ "
674+ Suppose z = cos(pi / 6) + i sin(pi / 6). By De Moivre's theorem, z**3 is
675+ z ** 3 = cos(3 pi / 6) + i sin(3 pi / 6) = cos(pi / 2) + sin(pi / 2) = 0 + i
676+ "
668677 z := (3 sqrt / 2 ) + (1 / 2 ) i.
669678 zCubed := (z raisedTo: 3 ) .
670679 self assert: zCubed closeTo: (0 + 1 i).
You can’t perform that action at this time.
0 commit comments