Hasnain Sir Class 15th Feb

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Practical 15th Feb

In[1]:= z = x+yI
Out[1]= x+ⅈy

In[2]:= Abs[z] // N
Out[2]= Abs[x + (0. + 1. ⅈ) y]

In[3]:= Arg[z]
Out[3]= Arg[x + ⅈ y]

In[4]:= ClearAll
Out[4]= ClearAll

In[5]:= z = 5-6I
Out[5]= 5-6ⅈ

In[6]:= Abs[z]
Out[6]= 61

In[7]:= Arg[z]
6
Out[7]= - ArcTan 
5

In[8]:= z1 = 2 + 6 I
Out[8]= 2+6ⅈ

In[9]:= z2 = - 3 + 4 I
Out[9]= -3 + 4 ⅈ

In[10]:= z1 + z2
Out[10]= - 1 + 10 ⅈ

In[11]:= z1 z2
Out[11]= - 30 - 10 ⅈ

In[12]:= z1 - z2
Out[12]= 5+2ⅈ

In[13]:= Abs[z1 + z2]


Out[13]= 101

In[14]:= Arg[z1 + z2]


Out[14]= π - ArcTan[10]
2

In[15]:= Abs[z1 z2]


Out[15]= 10 10

In[16]:= Arg[z1 z2]


1
Out[16]= - π + ArcTan 
3

In[17]:= Abs[z1 - z2]


Out[17]= 29

In[18]:= Arg[z1 - z2]


2
Out[18]= ArcTan 
5

In[19]:= z1 / z2
18 26 ⅈ
Out[19]= -
25 25

In[20]:= ClearAll
Out[20]= ClearAll

In[21]:= z := x + yI

In[22]:= Print["Complex Number z= x=yi"]


Complex Number z= x=yi

In[23]:= Re[z]
Out[23]= Re[x + yI]

In[24]:= Im[z]
Out[24]= Im[x + yI]

In[25]:= Conjugate[z]
Out[25]= Conjugate[x + yI]

In[26]:= Conjugate[z1]
Out[26]= 2-6ⅈ

In[27]:= Re[z1]
Out[27]= 2

In[28]:= Im[Conjugate[z1]]
Out[28]= -6

In[29]:= z2 = 6 - 7 I
Out[29]= 6-7ⅈ
3

In[30]:= Re[z2]
Out[30]= 6

In[31]:= Im[z2]
Out[31]= -7

In[32]:= Conjugate[z2]
Out[32]= 6+7ⅈ

In[33]:= Abs[z2]
Out[33]= 85

In[34]:= Arg[z2] // N
Out[34]= - 0.86217

In[35]:= N[Arg[z2]]
Out[35]= - 0.86217

In[36]:= N[z1 / Conjugate[z1]]


Out[36]= - 0.8 + 0.6 ⅈ

In[37]:= z1 / Conjugate[z1]
4 3ⅈ
Out[37]= - +
5 5

In[38]:= x = {1, 1 + I, 1 + 3 I}
Out[38]= {1, 1 + ⅈ, 1 + 3 ⅈ}

In[39]:= r = Abs[x]
Out[39]= 1, 2, 10 

In[40]:= t = Arg[x]
π
Out[40]= 0, , ArcTan[3]
4

In[41]:= Polarform = r * Exp[I * t]


ⅈπ

Out[41]= 1, 2 ⅇ4, 10 ⅇⅈ ArcTan3 

In[42]:= ComplexExpand[Polarform]
Out[42]= {1, 1 + ⅈ, 1 + 3 ⅈ}

In[43]:= Conjugate[x]
Out[43]= {1, 1 - ⅈ, 1 - 3 ⅈ}
4

In[44]:= z = 2-3I
Out[44]= 2-3ⅈ

In[45]:= ListLinePlot[{{0, 0}, {Re[z], Im[z]}}, AxesLabel → {"x", "y"}, PlotStyle → {Dotted, Pink}]
y
x
0.5 1.0 1.5 2.0

-0.5

-1.0

Out[45]=
-1.5

-2.0

-2.5

-3.0

In[46]:= z1 = - 2 + 5 I
Out[46]= -2 + 5 ⅈ

In[47]:= ListLinePlot[{{{0, 0}, {Re[z], Im[z]}}, {{0, 0}, {Re[z1], Im[z1]}}},


AxesLabel → {"x", "y"}, PlotStyle → {{Dotted, Pink}, {Dashed, Blue}}]
y

2
Out[47]=

x
-2 -1 1 2

-2

In[48]:= a = {1, 2};

In[49]:= b = {2, 1};

In[50]:= o = {0, 0};


5

In[51]:= ListPlot[{{a, o}, {b, o}, {a + b, o}}, Joined → True, Mesh → All,
PlotLegends → "Expressions", PlotStyle → {Dashed, Thick, Dotted}]

3.0

2.5

2.0

Out[51]= 1.5

1.0

0.5

0.5 1.0 1.5 2.0 2.5 3.0

In[52]:= ListPlot[{{a, o}, {b, o}, {- b, o}, {a - b, o}}, Joined → True, Mesh → All,
PlotLegends → "Expressions", PlotStyle → {Dashed, Thick, Dotted}]

2.0

1.5

1.0

Out[52]= 0.5

-2 -1 1 2

-0.5

-1.0

In[53]:= ListPlot[{{a, o}, {b, o}, {- b, o}, {a - b, o}}, Joined → False, Mesh → All,
PlotLegends → "Expressions", PlotStyle → {Dashed, Thick, Dotted}]

2.0

1.5

1.0

Out[53]= 0.5

-2 -1 1 2

-0.5

-1.0
6

In[54]:= ListLinePlot[{{a, o}, {b, o}, {- b, o}, {a - b, o}}, Mesh → All,


PlotLegends → "Expressions", PlotStyle → {Dashed, Thick, Dotted}]

2.0

1.5

1.0

Out[54]= 0.5

-2 -1 1 2

-0.5

-1.0

In[55]:= ListLinePlot[{{a, o}, {b, o}, {- b, o}, {a - b, o}, {- b, a - b}}, Mesh → All,
PlotLegends → "Expressions", PlotStyle → {Dashed, Thick, Dotted}]

2.0

1.5

1.0

Out[55]= 0.5

-2 -1 1 2

-0.5

-1.0

In[56]:= ListLinePlot[{{a, o}, {b, o}, {- b, o}, {a - b, o}, {- b, a - b}, {a, a - b}},
Mesh → All, PlotLegends → "Expressions", PlotStyle → {Dashed, Thick, Dotted}]

2.0

1.5

1.0

Out[56]= 0.5

-2 -1 1 2

-0.5

-1.0
7

In[58]:= ClearAll
Out[58]= ClearAll

In[59]:= z1 = 1 + 2 I
Out[59]= 1+2ⅈ

In[60]:= z2 = 1 + 3 I
Out[60]= 1+3ⅈ

In[61]:= z1 + z2
Out[61]= 2+5ⅈ

In[62]:= z1 - z2
Out[62]= -ⅈ

In[63]:= z1 z2
Out[63]= -5 + 5 ⅈ

In[64]:= z1 / z2
7 ⅈ
Out[64]= -
10 10

In[65]:= N[z1 / z2]


Out[65]= 0.7 - 0.1 ⅈ

In[68]:= v = {Re[z1], Im[z1]}


Out[68]= {1, 2}
8

In[71]:= g = Show[Graphics[{Dashed, Arrow[{{0, 0}, v}], Text[z1, {0.4, 1.0}]},


Axes → True, AxesStyle → Arrowheads[- 0.03, 0.03]]]

1.5

Out[71]= 1.0 1+2ⅈ

0.5

0.2 0.4 0.6 0.8

w = Show[Graphics[{Dashed, Arrow[{{0, 0}, v}], Text[z1, {0.4, 1.0}]},


Axes → True, AxesStyle → Arrowheads[- 0.03, 0.03]]]

In[72]:= s = z1 z2
Out[72]= -5 + 5 ⅈ

In[73]:= A = {Re[s], Im[s]}


Out[73]= {- 5, 5}
9

In[74]:= Show[Graphics[{Dashed, Arrow[{{0, 0}, A}], Text[s, {- 2.5, 3}]},


Axes → True, AxesStyle → Arrowheads[- 0.03, 0.03]]]

-5 + 5 ⅈ 3

Out[74]=

-5 -4 -3 -2 -1

In[75]:= S = N[z1 / z2]


Out[75]= 0.7 - 0.1 ⅈ

In[76]:= B = {Re[S], Im[S]}


Out[76]= {0.7, - 0.1}

In[78]:= Show[Graphics[{Dashed, Arrow[{{0, 0}, B}], Text[S, {0.30, - 0.06}]},


Axes → True, AxesStyle → Arrowheads[- 0.03, 0.03]]]

-0.02 0.1 0.2 0.3 0.4 0.5 0.6


Out[78]= -0.04
-0.06 0.7 - 0.1 ⅈ
-0.08
-0.10

In[79]:= X = z1 + z2
Out[79]= 2+5ⅈ

In[80]:= x1 = {Re[X], Im[X]}


Out[80]= {2, 5}
10

In[86]:= Show[Graphics[{Dashed, Arrow[{{0, 0}, x1}], Text[X, {1.3, 2.5}]},


Axes → True, AxesStyle → Arrowheads[- 0.03, 0.03]]]

Out[86]= 2+5ⅈ

0.5 1.0 1.5

In[82]:= Y = z1 - z2
Out[82]= -ⅈ

In[83]:= y1 = {Re[Y], Im[Y]}


Out[83]= {0, - 1}

In[92]:= Show[Graphics[{Dashed, Arrow[{{0, 0}, y1}], Text[Y, {0, - 0.5}]},


Axes → True, AxesStyle → Arrowheads[{- 0.03, 0.03}]]]

-0.5 0.5

-0.2

-0.4
Out[92]= -ⅈ
-0.6

-0.8

You might also like