Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
27
Task/Trigonometric-functions/C/trigonometric-functions.c
Normal file
27
Task/Trigonometric-functions/C/trigonometric-functions.c
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
double pi = 4 * atan(1);
|
||||
/*Pi / 4 is 45 degrees. All answers should be the same.*/
|
||||
double radians = pi / 4;
|
||||
double degrees = 45.0;
|
||||
double temp;
|
||||
/*sine*/
|
||||
printf("%f %f\n", sin(radians), sin(degrees * pi / 180));
|
||||
/*cosine*/
|
||||
printf("%f %f\n", cos(radians), cos(degrees * pi / 180));
|
||||
/*tangent*/
|
||||
printf("%f %f\n", tan(radians), tan(degrees * pi / 180));
|
||||
/*arcsine*/
|
||||
temp = asin(sin(radians));
|
||||
printf("%f %f\n", temp, temp * 180 / pi);
|
||||
/*arccosine*/
|
||||
temp = acos(cos(radians));
|
||||
printf("%f %f\n", temp, temp * 180 / pi);
|
||||
/*arctangent*/
|
||||
temp = atan(tan(radians));
|
||||
printf("%f %f\n", temp, temp * 180 / pi);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue