/
LIB3/
LIB3/D/ADMIN/
LIB3/D/ADMIN/OBJ/
LIB3/D/ADMIN/ROOM/W/
LIB3/D/HOME/
LIB3/D/HOME/CITY/ARENA/
LIB3/D/HOME/CITY/ITEMS/
LIB3/D/HOME/CITY/POSTOFFI/
LIB3/DOC/
LIB3/GLOBAL/SPECIAL/
LIB3/GLOBAL/VIRTUAL/
LIB3/NET/
LIB3/NET/CONFIG/
LIB3/NET/DAEMON/CHARS/
LIB3/NET/GOPHER/
LIB3/NET/INHERIT/
LIB3/NET/OBJ/
LIB3/NET/SAVE/
LIB3/NET/VIRTUAL/
LIB3/OBJ/B_DAY/
LIB3/OBJ/HANDLERS/TERM_TYP/
LIB3/PLAYERS/B/
LIB3/PLAYERS/N/
LIB3/ROOM/
LIB3/SAVE/
LIB3/SAVE/BOARDS/
LIB3/SAVE/ENVIRON/
LIB3/SAVE/POST/
LIB3/STD/COMMANDS/SHADOWS/
LIB3/STD/CREATOR/
LIB3/STD/DOM/
LIB3/STD/EFFECTS/
LIB3/STD/EFFECTS/HEALING/
LIB3/STD/EFFECTS/OTHER/
LIB3/STD/EFFECTS/POISONS/
LIB3/STD/ENVIRON/
LIB3/STD/GUILDS/
LIB3/STD/LIQUIDS/
LIB3/STD/ROOM/
LIB3/STD/TRIGGER/SHADOW/
LIB3/W/
LIB3/W/BANNOR/
LIB3/W/NEWSTYLE/
/* this is [als]'s wonder trig object */

int    *sintab;

create()
{
    sintab = ({ 
		   0, 17452, 34899, 52335, 69756, 87155, 104528, 121869, 139173, 156434,
		   173648, 190808, 207911, 224951, 241921, 258819, 275637, 292371,
		   309016, 325568, 342020, 358367, 374606, 390731, 406736, 422618,
		   438371, 453990, 469471, 484809, 500000, 515038, 529919, 544639,
		   559192, 573576, 587785, 601815, 615661, 629320, 642787, 656059,
		   669130, 681998, 694658, 707106, 719339, 731353, 743144, 754709,
		   766044, 777145, 788010, 798635, 809016, 819152, 829037, 838670,
		   848048, 857167, 866025, 874619, 882947, 891006, 898794, 906307,
		   913545, 920504, 927183, 933580, 939692, 945518, 951056, 956304,
		   961261, 965925, 970295, 974370, 978147, 981627, 984807, 987688,
		   990268, 992546, 994521, 996194, 997564, 998629, 999390, 999847, 1000000
		    });
}

int     sin( int angle )
/* return sin(angle in degrees) * 1000000 */
{
/* for 'huge' angles this may be slow, but for the small angles we are expecting
   it is fine */

    while( angle < 0 )
	angle += 360;
    while( angle >= 360 )
	angle -= 360;

    if( angle >= 270 )
	return -sintab[ 360 - angle ];
    if( angle >= 180 )
	return -sintab[ angle - 180 ];
    if( angle >= 90 )
	return sintab[ 180 - angle ];
    return sintab[ angle ];
}

int     cos( int angle )
{
    return sin( 90 - angle );
}

int     tan( int angle )
{
/* 1000 * 1e6 is the maximum ... so we have to divide the bottom by 1000 :(
   losing accuracy along the way of course. */

    return 1000 * sin( angle ) / (sin( 90 - angle ) / 1000);
}