1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>TAN Trigonometric Tangent Function
</TITLE>
</HEAD>
<BODY>
<H2>TAN Trigonometric Tangent Function
</H2>
<P>
Section: <A HREF=sec_mathfunctions.html> Mathematical Functions </A>
<H3>Usage</H3>
Computes the <code>tan</code> function for its argument. The general
syntax for its use is
<PRE>
y = tan(x)
</PRE>
<P>
where <code>x</code> is an <code>n</code>-dimensional array of numerical type.
Integer types are promoted to the <code>double</code> type prior to
calculation of the <code>tan</code> function. Output <code>y</code> is of the
same size and type as the input <code>x</code>, (unless <code>x</code> is an
integer, in which case <code>y</code> is a <code>double</code> type).
<H3>Function Internals</H3>
Mathematically, the <code>tan</code> function is defined for all real
valued arguments <code>x</code> by the infinite summation
<P>
<DIV ALIGN="CENTER">
<IMG SRC="tan_eqn1.png">
</DIV>
<P>
or alternately by the ratio
<P>
<DIV ALIGN="CENTER">
<IMG SRC="tan_eqn2.png">
</DIV>
<P>
For complex valued arguments <code>z</code>, the tangent is computed via
<P>
<DIV ALIGN="CENTER">
<IMG SRC="tan_eqn3.png">
</DIV>
<P>
<H3>Example</H3>
The following piece of code plots the real-valued <code>tan(x)</code>
function over the interval <code>[-1,1]</code>:
<PRE>
--> t = linspace(-1,1);
--> plot(t,tan(t))
</PRE>
<P>
<P>
<DIV ALIGN="CENTER">
<IMG SRC="tanplot.png">
</DIV>
<P>
</BODY>
</HTML>
|