summaryrefslogtreecommitdiff
path: root/2915/CH1/EX1.25/Ex1_25.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2915/CH1/EX1.25/Ex1_25.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '2915/CH1/EX1.25/Ex1_25.sce')
-rwxr-xr-x2915/CH1/EX1.25/Ex1_25.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/2915/CH1/EX1.25/Ex1_25.sce b/2915/CH1/EX1.25/Ex1_25.sce
new file mode 100755
index 000000000..034d727ad
--- /dev/null
+++ b/2915/CH1/EX1.25/Ex1_25.sce
@@ -0,0 +1,26 @@
+clc,clear
+//Example 1.25
+//To find sin_theta and tan_theta when cos_theta is given
+
+cos_theta = -4/5;
+adjacent =4 ; hypotenuse =5 ;
+opposite = sqrt(hypotenuse ^2 - adjacent ^2) //by pythagoras theorem
+
+//minus sign of cos_theta implies 2nd or 3rd quadrant
+//Possibility 1 : 2nd quadrant
+x= -adjacent ;
+y= opposite ;
+r= hypotenuse ;
+sin_theta = y/r ;
+tan_theta = y/x ;
+printf('POSSIBILITY 1:Theta in 2nd quadrant\n')
+printf('sin(theta)= %.2f ; tan(theta) = %.2f; \n\n',sin_theta,tan_theta)
+
+//Possibility 2 : 3rd quadrant
+x=-adjacent ;
+y=-opposite ;
+r=hypotenuse ;
+sin_theta = y/r ;
+tan_theta = y/x ;
+printf('POSSIBILITY 2:Theta in 3rd quadrant\n')
+printf('sin(theta)= %.2f ; tan(theta) = %.2f; ',sin_theta,tan_theta)