Ruby | Math sin() function Last Updated : 04 Dec, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The sin() is an inbuilt function in Ruby returns the sine of a given angle expressed in radians which is in range [-inf, +inf]. The returned value is in range [-1, +1]. Syntax: Math.sin(value) Parameters: The function accepts one mandatory parameter value whose corresponding sine is returned. Return Value: It returns the sine. Example 1: Ruby #Ruby program for sin() function #Assigning values val1 = 176 val2 = Math::PI / 2 val3 = -3123 val4 = -89 #Prints the sin() value puts Math.sin(val1) puts Math.sin(val2) puts Math.sin(val3) puts Math.sin(val4) Output: 0.07075223608034517 1.0 -0.25408576770942626 -0.8600694058124533 Example 2: Ruby #Ruby program for sin() function #Assigning values val1 = 1 val2 = 0 val3 = 989 val4 = -8932 #Prints the sin() value puts Math.sin(val1) puts Math.sin(val2) puts Math.sin(val3) puts Math.sin(val4) Output: 0.8414709848078965 0.0 0.5660330877786267 0.43684277891924755 Reference: https://devdocs.io/ruby~2.5/math#method-c-sin Comment More infoAdvertise with us Next Article Ruby | Math sin() function G gopaldave Follow Improve Article Tags : Ruby Ruby-Methods Ruby Collections Ruby Math-class Similar Reads Ruby | Math sinh() function The sinh() is an inbuilt function in Ruby returns the hyperbolic sine of value given in radians. The value passed is in range [-inf, +inf]. The returned value is in range [-inf, +inf]. Syntax: Math.sinh(value) Parameters: The function accepts one mandatory parameter value whose corresponding hyperbo 1 min read Ruby | Math tan() function The tan() is an inbuilt function in Ruby returns the tangent of a given angle expressed in radians which is in range [-inf, +inf]. The returned value is in range [-inf, +inf]. Syntax: Math.tan(value) Parameters: The function accepts one mandatory parameter value whose corresponding tangent value is 1 min read Ruby | Math tanh() function The tanh() is an inbuilt function in Ruby returns the hyperbolic tangent of value given in radians. The value passed is in range [-inf, +inf]. The returned value is in range [-1, +1]. Syntax: Math.tanh(value) Parameters: The function accepts one mandatory parameter value whose corresponding hyperbol 1 min read Ruby | Math sqrt() function The sqrt() is an inbuilt function in Ruby returns the square root of a given value. Syntax: Math.sqrt(value) Parameters: The function accepts one mandatory parameter value whose square root is to be returned. Return Value: It returns the square root of the value. Example 1: CPP #Ruby program for sqr 1 min read Ruby | Math cos() function The cos() is an inbuilt function in Ruby returns the cosine value of a given angle expressed in radians which is in range [-inf, +inf]. The returned value is in range [-1, +1]. Syntax: Math.cos(value) Parameters: The function accepts one mandatory parameter value whose corresponding cosine value is 1 min read Like