blob: 81fa6b5f440c91cd73d68f82b200bddfbe39f864 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
clc,clear
//example 1.6
//To find values of all trigonometric functions for 45 degree
//Consider a square of side 1 and divide it half diagonally
//ABC is now an isosceles triangle
//angle A and B are now equal and = 45 degree
AC=1;
BC=1;
AB=sqrt(AC^2+BC^2) //by pythagoras theorem
c=AB //we denote AB by c as its opposite to C
//conside angle BAC=45 degree
opposite = BC;
adjacent = AC;
hypotenuse = c;
sin_45 = opposite / hypotenuse;
cos_45 = adjacent / hypotenuse;
tan_45 = opposite / adjacent;
csc_45 = hypotenuse/opposite;
sec_45 = hypotenuse/adjacent;
cot_45 = adjacent / opposite;
printf('ANGLE = 45 degree')
printf('\nsin(45)= %.4f ; cos(45)= %.4f; tan(45)= %.2f;\n',sin_45,cos_45,tan_45)
printf('csc(45)= %.4f ; sec(45)= %.4f; cot(45)= %.2f;',csc_45,sec_45,cot_45)
|