tand
Tangent of an angle in degrees.
Category: Mathematics > Elementary Math
Syntax
Y = tand(X)
Returns the tangent of each element of X, with X in degrees.
Description
Unlike tan(x*pi/180), tand knows the exact special angles: tand(90) is Inf and tand(180) is 0. This matters in slope and surveying calculations, where the angle arrives in degrees and the asymptote at 90 degrees must be recognized as such.
Input arguments
X- Angles in degrees.
Output arguments
Y- Array of the same size as
X. At odd multiples of 90 the result isInf; at multiples of 180 it is exactly0.
Example
Special angles
tand([0 30 45 60 90])
tan(90*pi/180)
Output
ans = 1×5
0 0.5774 1.0000 1.7321 Inf
ans = 1.6331e+16