# sin

sin(x)

Compute sine of `x`, where `x` is in radians

## Examples

1. Calculate the sine of a single value:

``````julia> x = 0.5;
julia> sin(x)
0.479425538604203``````

This example computes the sine of the value `0.5` in radians.

2. Compute the sine of an array of values:

``````julia> angles = [0.0, π/6, π/4, π/3, π/2];
julia> sin(angles)
5-element Array{Float64,1}:
0.0
0.5
0.7071067811865476
0.8660254037844386
1.0``````

It calculates the sine of each element in the `angles` array.

3. Evaluate the sine function for a matrix:
``````julia> mat = [0.0  π/4;
π/3 π/2];
julia> sin(mat)
2×2 Array{Float64,2}:
0.0              0.7071067811865476
0.8660254037844386  1.0``````

In this example, the `sin` function is applied element-wise to each entry of the matrix.

Common mistake example:

``````julia> sin("1.0")
ERROR: MethodError: no method matching sin(::String)``````

In this case, the argument provided to the `sin` function is of type `String`, which is not compatible. Ensure that the input to `sin` is a numeric type, such as `Float64` or `Int`.