math hquickissential
DESCRIPTION
TRANSCRIPT
![Page 1: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/1.jpg)
Math.h
Math.h is a header file declared before using basic mathemical operation such as
Power (Squareroot, power) Trigonometric(Sine, cosine, tangent) Exponential and logarithmic (Log, exponential) Rounding, Absolute value Etc etc
![Page 2: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/2.jpg)
Power
Power Example : x^y should be written as power(x,y); Example in coding:
#include <stdio.h>
#include <math.h>
int main (){
printf ("7 ^ 3 = %lf\n", pow (7,3));
printf ("4.73 ^ 12 = %lf\n", pow (4.73,12));
printf ("32.01 ^ 1.54 = %lf\n", pow (32.01,1.54));
return 0;
}
![Page 3: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/3.jpg)
Power
Squareroot Example : x^y should be written as power(x,y); Example in coding:
#include <stdio.h>
#include <math.h>
int main (){
double param, result;
param = 1024.0;
result = sqrt (param);
printf ("sqrt(%lf) = %lf\n", param, result );
return 0;
}
![Page 4: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/4.jpg)
Trigonometric
Sine Sin() Example: result = sin (param*PI/180);
Cosine cos() Example : result = cos (param*PI/180);
Tangent Tan() Example: result = tan (param*PI/180);
![Page 5: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/5.jpg)
Sine exaple
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double param, result;
param = 30.0;
result = sin (param*PI/180);
printf ("The sine of %lf degrees is %lf.\n", param, result );
return 0;
}
![Page 6: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/6.jpg)
cosine
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double param, result;
param = 60.0;
result = cos (param*PI/180);
printf ("The cosine of %lf degrees is %lf.\n", param, result );
return 0;
}
![Page 7: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/7.jpg)
Tangent
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double param, result;
param = 45.0;
result = tan (param*PI/180);
printf ("The tangent of %lf degrees is %lf.\n", param, result );
return 0;
}
![Page 8: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/8.jpg)
Log
Example :
#include <stdio.h>
#include <math.h>
int main (){
double param, result;
param = 5.5;
result = log (param);
printf ("ln(%lf) = %lf\n", param, result );
return 0;
}
![Page 9: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/9.jpg)
Exponential
Example :
#include <stdio.h>
#include <math.h>
int main (){
double param, result;
param = 5.0;
result = exp (param);
printf ("The exponential value of %lf is %lf.\n", param, result );
return 0;
}
![Page 10: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/10.jpg)
Absolute value
Example:
#include <stdio.h>
#include <math.h>
int main (){
printf ("The absolute value of 3.1416 is %lf\n", fabs (3.1416) );
printf ("The absolute value of -10.6 is %lf\n", fabs (-10.6) );
return 0;
}
![Page 11: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/11.jpg)
QUESTION?
![Page 12: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/12.jpg)
Log and exponential
Example :
#include <stdio.h>
#include <math.h>
int main (){
double param, result;
param = 5.5;
result = log (param);
printf ("ln(%lf) = %lf\n", param, result );
return 0;
}
![Page 13: Math hquickissential](https://reader035.vdocuments.site/reader035/viewer/2022070304/54be2f934a795961298b4573/html5/thumbnails/13.jpg)
Log and exponential
Example :
#include <stdio.h>
#include <math.h>
int main (){
double param, result;
param = 5.5;
result = log (param);
printf ("ln(%lf) = %lf\n", param, result );
return 0;
}