diff options
Diffstat (limited to 'Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10')
-rw-r--r-- | Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.1.1/Ex10.1_1.r | 13 | ||||
-rw-r--r-- | Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.2.1/EX10.2_1.r | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.1.1/Ex10.1_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.1.1/Ex10.1_1.r new file mode 100644 index 00000000..f40f7507 --- /dev/null +++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.1.1/Ex10.1_1.r @@ -0,0 +1,13 @@ +# Example : 1 Chapter : 10.1 Page No: 496
+# r of complex numbers
+rad2deg <- function(rad) {
+ (rad * 180) / (pi)
+}
+z<-complex(real=1,imaginary=1)
+z1<-Conj(z)
+print("r of z and its conjugate are")
+print(Mod(z))
+print(Mod(z1))
+print("The argument of z and its conjugate in degrees are")
+print(paste(rad2deg(Arg(z)),"degrees")) # in radians which is equal to 45 degree
+print(paste(rad2deg(Arg(z1)),"degrees"))
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.2.1/EX10.2_1.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.2.1/EX10.2_1.r new file mode 100644 index 00000000..2c71d894 --- /dev/null +++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH10/EX10.2.1/EX10.2_1.r @@ -0,0 +1,13 @@ +# Example : 1 Chapter : 10.2 Page No: 502
+# Orthogonal Complex vectors
+i<-complex(real=0,imaginary=1)
+u<-matrix(c(1,i),ncol=1)
+ut<-t(u)
+#take conjugate of ut
+ut[1,2]<-Conj(ut[1,2])
+v<-matrix(c(i,1),ncol=1)
+print("inner product of u and v is conj(u tanspose )* v is ")
+innerproduct<-ut%*%v
+print(innerproduct)
+print("As innerproduct is zero , they are orthogonal complex vectors")
+
|