tan Programmers Guide Contents | Index |  Search

Category:intervals,math Component type:function
Prototype
template <class Tnum>
interval<Tnum> tan(const interval<Tnum>& x) ;
Description
Computes the tangent of an interval. If the diameter of the interval is greater than 2*pi, it returns an interval of positive and negative infinity. If the left bound of the interval is greater than 1/2*pi and the right bound is less than 1/2*pi then it returns a quiet NaN.
``` Quadrants:
1st  [0,Pi/2]
2nd  [Pi/2,Pi]
3rd  [Pi,3Pi/2]
4th  [3Pi/2,2Pi]
tan(x) =
[-Inf,Inf]                   if x.inf() is the same quadrant as x.sup() and
x.sup() > (x.inf() + pi)
[tan(x.inf()),tan(x.sup())]  if x.inf() is in the 1st quadrant and x.sup() is in the 4th.
if x.inf() is in the 2nd quadrant and x.sup() is in the 2nd.
if x.inf() is in the 3rd quadrant and x.sup() is in the 2nd or 3rd.
if x.inf() is in the 4th quadrand and x.sup() is in the 4th.
```
Definition
interval.cct
Preconditions
Complexity
Example
In mathfunc.cc:
```  cout << "A:" << A << endl << endl;
cout << "Square     :" << sqr(A) << endl;
cout << "Square Root:" << sqrt(A) << endl;
cout << "Tangent    :" << tan(A) << endl;
cout << "ArcTangent :" << atan(A) << endl;
cout << "Sine       :" << sin(A) << endl;
cout << "Cosine     :" << cos(A) << endl;
cout << "Arcsine    :" << asin(A) << endl;
cout << "Arcosine   :" << acos(A) << endl;
cout << "Log        :" << log(A) << endl;
cout << "Ln         :" << ln(A) << endl;
cout << "Power (A^A):" << pow(A,A) << endl;
cout << "Exponent   :" << exp(A) << endl;

```
Notes