diff options
Diffstat (limited to '608/CH23/EX23.07')
-rwxr-xr-x | 608/CH23/EX23.07/23_07.sce | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/608/CH23/EX23.07/23_07.sce b/608/CH23/EX23.07/23_07.sce new file mode 100755 index 000000000..3788919c9 --- /dev/null +++ b/608/CH23/EX23.07/23_07.sce @@ -0,0 +1,20 @@ +//Problem 23.07: Determine (-2 + i3)^5 in polar and in cartesian form.
+
+//initializing the variables:
+z = -2 + %i*3;
+
+//calculation:
+zc = z^5
+x = real(zc)
+y = imag(zc)
+r = (x^2 + y^2)^0.5
+theta = atan(y/x)*180/%pi
+if ((x<0)&(y<0)) then
+ theta = theta -180;
+elseif ((x<0)&(y>0)) then
+ theta = theta +180;
+end
+
+printf("\n\n Result \n\n")
+printf("\n Z is %.0f + (%.0f)i", x,y)
+printf("\n ZT is (%.1f/_%.2f°)", r,theta)
\ No newline at end of file |