In C++, the sin() function is defined in the <cmath> or <math.h> header file and is used to calculate the sine of an angle specified in radians. The sine value represents the vertical coordinate of a point on the unit circle corresponding to the given angle.
The sin() function accepts positive, negative, and zero values as input and returns a value in the range from -1 to 1. It is widely used in trigonometry, physics, graphics programming, and mathematical calculations.
It has the following syntax.
x: The value specified in terms of radian.
It returns the sine of an angle given in radian in the range[-1,1].
Here, we are going to discuss several examples to demonstrate the Math sin() Function
This example demonstrates how to calculate the sine of a positive angle by converting degrees into radians and using the sin() function.
Output:
Sine of an angle is : 0.86576
Explanation:
In this example, sin() function calculates the sine of an angle when the degree is equal to 60.
This example demonstrates how the sin() function calculates the sine of a negative angle. The returned value is also negative when the angle is negative.
Output:
Sine of an angle is : -0.76576
Explanation:
In his example, sin() function finds the sine of an angle when the value of degree is negative i.e -50.
This example demonstrates how to calculate the sine of zero radians using the sin() function. The sine of zero is always equal to 0.
Output:
Sine of an angle is : 0
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India