INNER CODE UNIT · Python

scale

Is-Daouda/is-Engine · libs/freetype/src/tools/cordic.py:6

scale  = units/math.pi
shrink = 1.0
comma  = ""

print ""
print "table of arctan( 1/2^n ) for PI = " + repr(units/65536.0) + " units"

for n in range(1,32):

    x = 0.5**n                      # tangent value

    angle  = math.atan(x)           # arctangent
    angle2 = round(angle*scale)     # arctangent in FT_Angle units

    if angle2 <= 0:
        break

    sys.stdout.write( comma + repr( int(angle2) ) )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…