diff options
author | Rasmus Lerdorf <rasmus@php.net> | 2002-04-13 02:03:09 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 2002-04-13 02:03:09 +0000 |
commit | 7a8cade379e90bafca21cd983f2f5a4d84a7ff8a (patch) | |
tree | 3ad6b2f42fd690dd7acdf04a41173471f27b5ea7 /ext/gd/libgd/mathmake.c | |
parent | c46199f5b98c35b911d18eb6a9646ccb118d46ef (diff) | |
download | php-git-7a8cade379e90bafca21cd983f2f5a4d84a7ff8a.tar.gz |
Initial commit of the built-in libgd based on GD-2.0.1
This initial checkin has no changes to any of the libgd code so it can
be used as a basis for diffs. It also will not build currently because
of this. The PHP gd checks need to be incorporated along with a bit of
other config magic. It also shouldn't break the build and will only
take effect if you use --with-gd=php right now.
Diffstat (limited to 'ext/gd/libgd/mathmake.c')
-rw-r--r-- | ext/gd/libgd/mathmake.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/ext/gd/libgd/mathmake.c b/ext/gd/libgd/mathmake.c new file mode 100644 index 0000000000..3950c4b09c --- /dev/null +++ b/ext/gd/libgd/mathmake.c @@ -0,0 +1,52 @@ +#include <stdio.h> +#include <math.h> + +#define scale 1024 + +int basis[91]; +int cost[360]; + +main (void) +{ + int i; + printf ("#define costScale %d\n", scale); + printf ("int cost[] = {\n "); + for (i = 0; (i <= 90); i++) + { + basis[i] = cos ((double) i * .0174532925) * scale; + } + for (i = 0; (i < 90); i++) + { + printf ("%d,\n ", cost[i] = basis[i]); + } + for (i = 90; (i < 180); i++) + { + printf ("%d,\n ", cost[i] = -basis[180 - i]); + } + for (i = 180; (i < 270); i++) + { + printf ("%d,\n ", cost[i] = -basis[i - 180]); + } + for (i = 270; (i < 359); i++) + { + printf ("%d,\n ", cost[i] = basis[360 - i]); + } + printf ("%d\n", cost[359] = basis[1]); + printf ("};\n"); + printf ("#define sintScale %d\n", scale); + printf ("int sint[] = {\n "); + for (i = 0; (i < 360); i++) + { + int val; + val = cost[(i + 270) % 360]; + if (i != 359) + { + printf ("%d,\n ", val); + } + else + { + printf ("%d\n", val); + } + } + printf ("};\n"); +} |