以下的 cos 函数全部使用角度单位。
游戏用来计算余弦值的文件。其格式可在这里找到:http://will.kirk.by/labs/tt/edge/cos.bin
EdgeTool 反编译这个文件可以得到 cos.txt。这是一个有 181 行的文件,第 i 行中写的是 cos(i-1) 的值。
每个值精确到 1/256,即 0.00390625。你不能填写正负无穷大,因为每一行的数字都必须有取值范围:[-128,127.99609375],即 [ -128,128 )
如果删除这个文件,在游戏中玩家将不能通过倾斜方块来吃棱柱。
P.S. 虽然在通常情况下余弦的值域是[-1,1],但是很幸运我们可以使用一些更加大的值来实现一些神奇的功能。
标准 cos.txt:
1 0.99609375 0.99609375 0.99609375 0.99609375 0.99609375 0.9921875 0.9921875 0.98828125 0.984375 0.984375 0.98046875 0.9765625 0.97265625 0.96875 0.96484375 0.9609375 0.953125 0.94921875 0.9453125 0.9375 0.9296875 0.92578125 0.91796875 0.91015625 0.90625 0.8984375 0.890625 0.8828125 0.87109375 0.86328125 0.85546875 0.84765625 0.8359375 0.828125 0.81640625 0.80859375 0.796875 0.78515625 0.7734375 0.765625 0.75390625 0.7421875 0.73046875 0.71875 0.70703125 0.69140625 0.6796875 0.66796875 0.65234375 0.640625 0.62890625 0.61328125 0.6015625 0.5859375 0.5703125 0.55859375 0.54296875 0.52734375 0.51171875 0.5 0.484375 0.46875 0.453125 0.4375 0.421875 0.40625 0.390625 0.37109375 0.35546875 0.33984375 0.32421875 0.30859375 0.2890625 0.2734375 0.2578125 0.23828125 0.22265625 0.20703125 0.1875 0.171875 0.15625 0.13671875 0.12109375 0.1015625 0.0859375 0.06640625 0.05078125 0.03125 0.015625 0 -0.015625 -0.03125 -0.05078125 -0.06640625 -0.0859375 -0.1015625 -0.12109375 -0.13671875 -0.15625 -0.171875 -0.1875 -0.20703125 -0.22265625 -0.23828125 -0.2578125 -0.2734375 -0.2890625 -0.30859375 -0.32421875 -0.33984375 -0.35546875 -0.37109375 -0.390625 -0.40625 -0.421875 -0.4375 -0.453125 -0.46875 -0.484375 -0.49609375 -0.51171875 -0.52734375 -0.54296875 -0.55859375 -0.5703125 -0.5859375 -0.6015625 -0.61328125 -0.62890625 -0.640625 -0.65234375 -0.66796875 -0.6796875 -0.69140625 -0.70703125 -0.71875 -0.73046875 -0.7421875 -0.75390625 -0.765625 -0.7734375 -0.78515625 -0.796875 -0.80859375 -0.81640625 -0.828125 -0.8359375 -0.84765625 -0.85546875 -0.86328125 -0.87109375 -0.8828125 -0.890625 -0.8984375 -0.90625 -0.91015625 -0.91796875 -0.92578125 -0.9296875 -0.9375 -0.9453125 -0.94921875 -0.953125 -0.9609375 -0.96484375 -0.96875 -0.97265625 -0.9765625 -0.98046875 -0.984375 -0.984375 -0.98828125 -0.9921875 -0.9921875 -0.99609375 -0.99609375 -0.99609375 -0.99609375 -0.99609375 -1
附图:余弦函数在[0°,180°]内的图像(Google 绘制)