Method: Math#sin

Defined in:
math.c

#sin(x) ⇒ Float (private)

Returns the sine of x in radians.

  • Domain: (-INFINITY, INFINITY).

  • Range: [-1.0, 1.0].

Examples:

sin(-PI)   # => -1.2246063538223773e-16 # -0.0000000000000001
sin(-PI/2) # => -1.0
sin(0.0)   # => 0.0
sin(PI/2)  # => 1.0
sin(PI)    # => 1.2246063538223773e-16  # 0.0000000000000001

Returns:



139
140
141
142
143
# File 'math.c', line 139

static VALUE
math_sin(VALUE unused_obj, VALUE x)
{
    return DBL2NUM(sin(Get_Double(x)));
}