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 example - C Tutorial
From the course: C Standard Library
Trigonometric functions example
- [Instructor] Trigonometric functions are very straightforward. So in this example I will concentrate on illustrating the angle system they use so that you know if they use radians or degrees. So let's do that with a printf and I'll type sine of 90 degrees equals this value. And I'll call sine of 90.0. So the sine of 90 degrees is one. So if we get something other than one, well it must be radians. So let's take a look. And as you can see we get 0.89, so it's not one. Let's make some changes then. And let me change what I am sending to the sine. Let's say pi divided by 2.0. So pi divided by two is 90 degrees, expressed in radians. So let me define that constant to this very nice value of pi. Let's see it working now. And now we get that sine of 90 degrees is one. So there you have it, trigonometric functions in the C standard library use the angle in radians.
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
-
-