summaryrefslogtreecommitdiff
path: root/3793/CH2/EX2.2
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3793/CH2/EX2.2
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3793/CH2/EX2.2')
-rw-r--r--3793/CH2/EX2.2/exp_2_2.sce25
1 files changed, 25 insertions, 0 deletions
diff --git a/3793/CH2/EX2.2/exp_2_2.sce b/3793/CH2/EX2.2/exp_2_2.sce
new file mode 100644
index 000000000..a185fff41
--- /dev/null
+++ b/3793/CH2/EX2.2/exp_2_2.sce
@@ -0,0 +1,25 @@
+clear;
+clc;
+function [r,th]=rect2pol(x,y)
+//rectangle to polar coordinate conversion
+ r=sqrt(x^2+y^2);
+ th = atan(y,x)*180/%pi;
+endfunction
+ // linear cominations
+ // 1 part (1+a)
+ a=complex((-0.5),0.866);
+ b=1+a;
+ [r,th]=rect2pol(real(b),imag(b));
+ mprintf("a) magnitude = %f, Angle = %f\n",r,th);
+ // 2 part (a^2 - 1)
+c=((a^2)-1)
+[r,th]=rect2pol(real(c),imag(c));
+ mprintf(" b) magnitude = %f, Angle = %f\n",r,th);
+ // 3 part (a^2 + a)
+d=((a^2)+a)
+[r,th]=rect2pol(real(d),imag(d));
+ mprintf(" c) magnitude = %f, Angle = %f\n",r,th);
+ // 4 part (a^2 + a + 1)
+e=((a^2)+a+1)
+[r,th]=rect2pol(real(e),imag(e));
+ mprintf(" d) magnitude = %f, Angle = %f",r,th);