tgmath


1. Calculating Sine and Cosine Values

#include <tgmath.h>

double angle_radians = 45.0 * (M_PI / 180.0);
double sine_value = sin(angle_radians);
double cosine_value = cos(angle_radians);

cout << "Sine value: " << sine_value << endl;
cout << "Cosine value: " << cosine_value << endl;

2. Solving Trigonometric Equations

#include <tgmath.h>

double angle = atan2(opposite, adjacent);

cout << "Angle in radians: " << angle << endl;

3. Converting Degrees to Radians

#include <tgmath.h>

double angle_degrees = 45.0;
double angle_radians = angle_degrees * (M_PI / 180.0);

cout << "Angle in radians: " << angle_radians << endl;

4. Calculating the Hypotenuse of a Right Triangle

5. Finding the Area of a Circle

6. Calculating the Circumference of a Circle

7. Finding the Slope of a Line

8. Solving Quadratic Equations

9. Finding the Roots of a Complex Number

10. Calculating the Variance of a Data Set

11. Finding the Standard Deviation of a Data Set

12. Calculating the Probability Density Function of a Normal Distribution

13. Finding the Mode of a Data Set

14. Calculating the Median of a Data Set

15. Finding the Quartiles of a Data Set

16. Calculating the Interquartile Range of a Data Set

17. Finding the Outliers in a Data Set

18. Calculating the Correlation Coefficient between Two Data Sets

19. Finding the Linear Regression Line for Two Data Sets

20. Calculating the Minimum Value of a Data Set

21. Finding the Maximum Value of a Data Set

22. Calculating the Sum of a Data Set

23. Finding the Product of a Data Set

24. Calculating the Mean of a Data Set

25. Finding the Range of a Data Set

26. Calculating the Absolute Deviation from the Mean