Annotation of researchv10no/cmd/pico/psin.c, revision 1.1

1.1     ! root        1: static
        !             2: short costab[91]={
        !             3:        10000,  9998,   9993,   9986,   9975,
        !             4:        9961,   9945,   9925,   9902,   9876,
        !             5:        9848,   9816,   9781,   9743,   9702,
        !             6:        9659,   9612,   9563,   9510,   9455,
        !             7:        9396,   9335,   9271,   9205,   9135,
        !             8:        9063,   8987,   8910,   8829,   8746,
        !             9:        8660,   8571,   8480,   8386,   8290,
        !            10:        8191,   8090,   7986,   7880,   7771,
        !            11:        7660,   7547,   7431,   7313,   7193,
        !            12:        7071,   6946,   6819,   6691,   6560,
        !            13:        6427,   6293,   6156,   6018,   5877,
        !            14:        5735,   5591,   5446,   5299,   5150,
        !            15:        5000,   4848,   4694,   4539,   4383,
        !            16:        4226,   4067,   3907,   3746,   3583,
        !            17:        3420,   3255,   3090,   2923,   2756,
        !            18:        2588,   2419,   2249,   2079,   1908,
        !            19:        1736,   1564,   1391,   1218,   1045,
        !            20:        871,    697,    523,    348,    174,
        !            21:        0,
        !            22: };
        !            23: 
        !            24: pcos(x)
        !            25:        register x;
        !            26: {
        !            27:        x %= 360;
        !            28:        while(x<0)
        !            29:                x+=360;
        !            30:        if(x<=180)
        !            31:                return(x<90? costab[x] : -costab[180-x]);
        !            32:        return(x<180+90? -costab[x-180] : costab[360-x]);
        !            33: }
        !            34: 
        !            35: psin(x)
        !            36:        register x;
        !            37: {
        !            38:        return(pcos(x-90));
        !            39: }
        !            40: 
        !            41: Psin(x)
        !            42:        register x;
        !            43: {
        !            44:        return(Pcos(x-9000));
        !            45: }
        !            46: 
        !            47: Pcos(x)
        !            48:        register x;
        !            49: {
        !            50:        register int a = x/100;
        !            51:        register int b = x%100;
        !            52:        register int c = pcos(a);
        !            53:        register int d = pcos(a+1);
        !            54: 
        !            55:        a = c + (b*(d-c))/100;
        !            56:        return a;
        !            57: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.