TrigonometryTableAtan Actionscript
Table of contents | Previous document | Download TrigonometryTableAtan.as | SWF!T Homepage RCSfile: TrigonometryTableAtan.as,v Revision: 1.1 Date: 2003/02/13 17:59:03
Copyright 2003 Orgdot AS. All Rights Reserved. http://dev.swfit.com
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This will generate a table of trigonometric values for Flash4 and place those values into level 0 of the movie. The basis for this script is the values generated by TrigonometryTable.as, which we use to generate an inverse tangens table across the first octant.
author Olaf Havnes
version Revision: 1.1 Date: 2003/02/13 17:59:03
since SWFIT1.0
i = 0;
prev = 0;
while (i < /:NUM_DEG / (/:DEG_MULT * 2))
{
SIN = eval ("/:SIN_" add i);
COS = eval ("/:COS_" add i);
t00 = int (100.0 * SIN / COS);
atan = i / DEG_MULT;
average across any previous values for this t00
if (eval ("/:ATAN_" add t00))
{
atan = (eval ("/:ATAN_" add t00) * prev + atan) / (prev + 1);
set ("/:ATAN_" add t00, atan);
prev++;
}
else
{
set ("/:ATAN_" add t00, atan);
prev = 1;
}
i++;
}
|
|