1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Table-based cosine approximation. |
6 |
|
* |
8 |
|
* to avoid conversion and guarantee that tsin(x)^2 + tcos(x)^2 == 1. |
9 |
|
* |
10 |
|
* No interpolation in this version. |
11 |
+ |
* |
12 |
+ |
* External symbols declared in standard.h |
13 |
+ |
*/ |
14 |
+ |
|
15 |
+ |
/* ==================================================================== |
16 |
+ |
* The Radiance Software License, Version 1.0 |
17 |
+ |
* |
18 |
+ |
* Copyright (c) 1990 - 2002 The Regents of the University of California, |
19 |
+ |
* through Lawrence Berkeley National Laboratory. All rights reserved. |
20 |
+ |
* |
21 |
+ |
* Redistribution and use in source and binary forms, with or without |
22 |
+ |
* modification, are permitted provided that the following conditions |
23 |
+ |
* are met: |
24 |
+ |
* |
25 |
+ |
* 1. Redistributions of source code must retain the above copyright |
26 |
+ |
* notice, this list of conditions and the following disclaimer. |
27 |
+ |
* |
28 |
+ |
* 2. Redistributions in binary form must reproduce the above copyright |
29 |
+ |
* notice, this list of conditions and the following disclaimer in |
30 |
+ |
* the documentation and/or other materials provided with the |
31 |
+ |
* distribution. |
32 |
+ |
* |
33 |
+ |
* 3. The end-user documentation included with the redistribution, |
34 |
+ |
* if any, must include the following acknowledgment: |
35 |
+ |
* "This product includes Radiance software |
36 |
+ |
* (http://radsite.lbl.gov/) |
37 |
+ |
* developed by the Lawrence Berkeley National Laboratory |
38 |
+ |
* (http://www.lbl.gov/)." |
39 |
+ |
* Alternately, this acknowledgment may appear in the software itself, |
40 |
+ |
* if and wherever such third-party acknowledgments normally appear. |
41 |
+ |
* |
42 |
+ |
* 4. The names "Radiance," "Lawrence Berkeley National Laboratory" |
43 |
+ |
* and "The Regents of the University of California" must |
44 |
+ |
* not be used to endorse or promote products derived from this |
45 |
+ |
* software without prior written permission. For written |
46 |
+ |
* permission, please contact [email protected]. |
47 |
+ |
* |
48 |
+ |
* 5. Products derived from this software may not be called "Radiance", |
49 |
+ |
* nor may "Radiance" appear in their name, without prior written |
50 |
+ |
* permission of Lawrence Berkeley National Laboratory. |
51 |
+ |
* |
52 |
+ |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
53 |
+ |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
54 |
+ |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
55 |
+ |
* DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR |
56 |
+ |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
57 |
+ |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
58 |
+ |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
59 |
+ |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
60 |
+ |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
61 |
+ |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
62 |
+ |
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
63 |
+ |
* SUCH DAMAGE. |
64 |
+ |
* ==================================================================== |
65 |
+ |
* |
66 |
+ |
* This software consists of voluntary contributions made by many |
67 |
+ |
* individuals on behalf of Lawrence Berkeley National Laboratory. For more |
68 |
+ |
* information on Lawrence Berkeley National Laboratory, please see |
69 |
+ |
* <http://www.lbl.gov/>. |
70 |
|
*/ |
71 |
|
|
72 |
|
#include <math.h> |