sin
Sine of an angle in radians.
Category: Mathematics > Elementary Math
Syntax
Y = sin(X)
Returns the sine of each element of X, with X in radians.
Description
sin is odd and periodic with period 2*pi. Since pi is a rounded number, sin(pi) is about 1.2246e-16 rather than exactly zero. For exact results at multiples of a half turn, use sinpi, or sind for degrees.
For a complex argument, sin(x + iy) is sin(x)*cosh(y) + i*cos(x)*sinh(y), so the magnitude is no longer bounded by 1.
Input arguments
X- Angles in radians; real or complex.
Output arguments
Y- Array of the same size as
X. For real input the values lie between -1 and 1.
Example
Values and rounding at pi
sin([0 pi/6 pi/2])
sin(pi)
sin(1 + 1i)
Output
ans = 1×3
0 0.5000 1.0000
ans = 1.2246e-16
ans = 1.2985 + 0.6350i
Notes
Integer classes such as int8 are not accepted.