summaryrefslogtreecommitdiff
path: root/2915/CH6/EX6.13/Ex6_13.sce
diff options
context:
space:
mode:
Diffstat (limited to '2915/CH6/EX6.13/Ex6_13.sce')
-rwxr-xr-x2915/CH6/EX6.13/Ex6_13.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/2915/CH6/EX6.13/Ex6_13.sce b/2915/CH6/EX6.13/Ex6_13.sce
new file mode 100755
index 000000000..09ab024c2
--- /dev/null
+++ b/2915/CH6/EX6.13/Ex6_13.sce
@@ -0,0 +1,22 @@
+clc,clear
+//Example 6.13
+//To determine the cube roots of i
+
+z=%i //given complex number
+//modulii for cuberoots
+r1=abs(z)^(1/3)
+r2=abs(z)^(1/3)
+r3=abs(z)^(1/3)
+
+//arguements for cuberoots
+theta1= (phasemag(z)+360*0)/3
+theta2= (phasemag(z)+360*1)/3
+theta3= (phasemag(z)+360*2)/3
+
+cube_root_1 = r1 *(cosd(theta1)+ %i*sind(theta1))
+cube_root_2 = r2 *(cosd(theta2)+ %i*sind(theta2))
+cube_root_3 = r3 *(cosd(theta3)+ %i*sind(theta3))
+
+printf('cuberoot 1: %f + %f*i\n',real(cube_root_1),imag(cube_root_1))
+printf('cuberoot 2: %f + %f*i\n',real(cube_root_2),imag(cube_root_2))
+printf('cuberoot 3: %f + %f*i\n',real(cube_root_3),imag(cube_root_3))