diff options
author | Prashant S | 2019-10-04 12:27:32 +0530 |
---|---|---|
committer | GitHub | 2019-10-04 12:27:32 +0530 |
commit | ac2986488a9731cff5cbb517d8f0ef98e2561d64 (patch) | |
tree | 7bb3f64824627ef179d5f341266a664fd0b69011 /Basic_Engineering_Mathematics_by_John_Bird/CH22 | |
parent | cbb2770fb2f88246175add29623103a56ba338b8 (diff) | |
parent | b3f3a8ecd454359a2e992161844f2fb599f8238a (diff) | |
download | R_TBC_Uploads-master.tar.gz R_TBC_Uploads-master.tar.bz2 R_TBC_Uploads-master.zip |
Added R TBC
Diffstat (limited to 'Basic_Engineering_Mathematics_by_John_Bird/CH22')
10 files changed, 199 insertions, 0 deletions
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.1/Ex22_1.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.1/Ex22_1.R new file mode 100644 index 00000000..dcb7c0df --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.1/Ex22_1.R @@ -0,0 +1,14 @@ +#page no. 221
+#problem 1
+#formula used: pythagoras theorem
+
+hypo = function(base,perp)
+{
+ return(sqrt(base^2+perp^2))
+}
+
+#given:
+p = 4 #perpendicular height of triangle
+b = 3 #base of triangle
+h = hypo(b,p) #hypotenuse of triangle
+print(h)
\ No newline at end of file diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.10/Ex22_10.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.10/Ex22_10.R new file mode 100644 index 00000000..b7412ee9 --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.10/Ex22_10.R @@ -0,0 +1,5 @@ +#page no .225
+#problem 10
+#given:
+angle = 1.481
+sinQ = sin(angle)
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.11/Ex22_11.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.11/Ex22_11.R new file mode 100644 index 00000000..9fb8db93 --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.11/Ex22_11.R @@ -0,0 +1,7 @@ +#pageno.225
+#problem 11
+#function used: cos()
+#given:
+ angle=3*pi/5
+ cosQ = cos(angle)
+ print(cosQ)
\ No newline at end of file diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.2/Ex22_2.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.2/Ex22_2.R new file mode 100644 index 00000000..09e6f62c --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.2/Ex22_2.R @@ -0,0 +1,16 @@ +#page no. 221
+#problem 2
+#formula used: pythagoras theorem
+
+
+prep = function(hypo , base)
+{
+ return(sqrt(hypo^2 - base^2))
+}
+
+
+#given:
+b = 5 #perpendicular height of triangle
+h = 13 #hypotenuse of triangle
+p = prep(h,b) #base of triangle
+print(p)
\ No newline at end of file diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.3/Ex22_3.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.3/Ex22_3.R new file mode 100644 index 00000000..3040faa2 --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.3/Ex22_3.R @@ -0,0 +1,25 @@ +#page no. 221
+#problem 3
+#formula used: pythagoras theorem
+
+
+hypotenuse = function(base,perp)
+{
+ return(sqrt(base^2+perp^2))
+}
+
+distance = function(speed,time)
+{return(speed*time)}
+
+#given:
+s1 = 300 #speed of one air craft in km/hr
+s2 = 220 #speed of second air craft in km/hr
+time = 4 #In hr
+d1=distance(s1,time) #travels in north
+d2=distance(s2,time) #travels in west
+
+# both airplane make right angle triangle
+d3 = hypotenuse(d1,d2) #distance b/w two airplanes
+print(d3)
+
+
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.4/Ex22_4.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.4/Ex22_4.R new file mode 100644 index 00000000..f0823af9 --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.4/Ex22_4.R @@ -0,0 +1,22 @@ +#page no. 223
+#problem 4
+#formula used: sin=p/h cos=b/h tan=p/b
+
+sinQ = function(x,y)
+{return(x/y)}
+
+cosQ = function(x,y)
+{return(x/y)}
+
+tanQ = function(x,y)
+{return(x/y)}
+
+#given: right angle triangle
+b = 12
+p =5
+h = 13
+cat("sinQ=",sinQ(p,h))
+
+cat("cosQ=",cosQ(b,h))
+
+cat("tanQ=",tanQ(p,b))
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.5/Ex22_5.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.5/Ex22_5.R new file mode 100644 index 00000000..03909554 --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.5/Ex22_5.R @@ -0,0 +1,39 @@ +#page no. 223
+#problem 5
+#formula used: sin=p/h cos=b/h tan=p/b
+
+
+hypotenuse = function(base,perp)
+{
+ return(sqrt(base^2+perp^2))
+}
+
+sinQ = function(x,y)
+{return(x/y)}
+
+cosQ = function(x,y)
+{return(x/y)}
+
+tanQ = function(x,y)
+{return(x/y)}
+
+#given: right angle triangle
+base = 4.62
+perp = 3.47
+height = hypotenuse(base,perp)
+print(height)
+cat("sinC=",sinQ(perp,height))
+
+cat("cosC=",cosQ(base,height))
+
+cat("tanC=",tanQ(perp,base))
+
+# rotate the sides
+b = perp
+p = base
+h = height
+cat("sinA=",sinQ(p,h))
+
+cat("cosA=",cosQ(b,h))
+
+cat("tanA=",tanQ(p,b))
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.6/Ex22_6.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.6/Ex22_6.R new file mode 100644 index 00000000..108ddeeb --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.6/Ex22_6.R @@ -0,0 +1,45 @@ +#page no. 223
+#problem 6
+#formula used: sin=p/h cos=b/h tan=p/b
+
+
+hypotenuse = function(base,perp)
+{
+ return(sqrt(base^2+perp^2))
+}
+
+sinQ = function(x,y)
+{return(x/y)}
+
+cosQ = function(x,y)
+{return(x/y)}
+
+tanQ = function(x,y)
+{return(x/y)}
+
+
+
+#given: right angle triangle
+ tanB = 8/15 #tan = p/b
+ #according to angle B
+ p = 8 #perpendicular lenght opposite angle B
+ b = 15 #base lenght opposite angle B
+ h = hypotenuse(b,p)
+
+ cat("sinB=",sinQ(p,h))
+
+ cat("cosB=",cosQ(b,h))
+
+ #cat("tanB=",tanQ(p,b))
+
+ #according to angle A
+ base = p#base lenght opposite angle A
+ perp = b#perpendicular lenght opposite angle A
+ height = h
+
+ cat("sinA=",sinQ(perp,height))
+
+ #cat("cosA=",cosQ(base,height))
+
+ cat("tanA=",tanQ(perp,base))
+
\ No newline at end of file diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.8/Ex22_8.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.8/Ex22_8.R new file mode 100644 index 00000000..62276316 --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.8/Ex22_8.R @@ -0,0 +1,11 @@ +#page no. 225
+#problem 8
+#formula used: sin=p/h cos=b/h tan=p/b
+
+#given:
+angle_degree = 43 # angle in degree
+angle_min = 39 # angle in min
+
+#angel is 43 degree 39 min
+angle = ((angle_degree*60)+angle_min)/60 #conversion of angle into degree
+sinQ = sin(angle)
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.9/Ex22_9.R b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.9/Ex22_9.R new file mode 100644 index 00000000..e1a1ca02 --- /dev/null +++ b/Basic_Engineering_Mathematics_by_John_Bird/CH22/EX22.9/Ex22_9.R @@ -0,0 +1,15 @@ +#page no .225
+#problem 9
+# conversion minutes to degree
+angle = function(x,y)
+{
+ return(((x*60)+y)/60)
+}
+#given:
+angle_degree = 62 # angle in degree
+angle_min = 12 # angle in min
+
+deg = angle(angle_degree,angle_min)
+
+cosQ = cos(deg)
+cat("6cosQ:",6*cosQ)
|