w32tex About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.   Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)
cordic.py
Go to the documentation of this file.
1 # compute arctangent table for CORDIC computations in fttrigon.c
2 import sys, math
3
4 #units = 64*65536.0 # don't change !!
5 units = 180 * 2**16
6 scale = units/math.pi
7 shrink = 1.0
8 comma = ""
9
10 print ""
11 print "table of arctan( 1/2^n ) for PI = " + repr(units/65536.0) + " units"
12
13 for n in range(1,32):
14
15  x = 0.5**n # tangent value
16
17  angle = math.atan(x) # arctangent
18  angle2 = round(angle*scale) # arctangent in FT_Angle units
19
20  if angle2 <= 0:
21  break
22
23  sys.stdout.write( comma + repr( int(angle2) ) )
24  comma = ", "
25
26  shrink /= math.sqrt( 1 + x*x )
27
28 print
29 print "shrink factor = " + repr( shrink )
30 print "shrink factor 2 = " + repr( int( shrink * (2**32) ) )
31 print "expansion factor = " + repr( 1/shrink )
32 print ""
33
#define round(a)
Definition: pbmtopk.c:22
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
@ range
Definition: preamble.c:52