From the course: C Standard Library
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Trigonometric functions - C Tutorial
From the course: C Standard Library
Trigonometric functions
- [Narrator] Let me quickly walk you through the basic trigonometric functions present in math.h. The default type used for most functions in math.h is double. So here are the double versions of sine, cosine, and tangent. They receive a double representing an angle, and return a double as the result. Inverse trigonometric functions are also implemented. Here we have the arcsine, the arccosine, and the arctangent, which receive real numbers and return angles. These functions check the validity of the argument. For example, if 1.5 is sent to the arcsine function, it returns an invalid value, like NAN, or not a number. If you have worked with trigonometry in computers long enough, you may have come across some implementation of the atan2 function. This is a better implementation of the arctangent. Simply put, the arctangent is often used to calculate the angle of a complex number seen as a right triangle by dividing the vertical leg by the horizontal leg. And this division is sent as an…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Mathematical functions2m 50s
-
(Locked)
Rounding and truncating51s
-
(Locked)
Rounding and truncating example5m 4s
-
(Locked)
Trigonometric functions1m 42s
-
(Locked)
Trigonometric functions example1m 27s
-
(Locked)
Powers and exponentials1m 9s
-
(Locked)
Powers and exponentials example3m 4s
-
(Locked)
Challenge: Polar coordinate conversion2m 19s
-
(Locked)
Solution: Polar coordinate conversion6m 53s
-
(Locked)
C23 update3m 39s
-
-