All pastes #383000 Raw Edit

Someone

public text v1 · immutable
·published 2007-03-06 01:38 UTC
rendered paste body
function atand(x,y)
{
	fh=document.vf6;
	if(Math.abs(x)<Math.pow(10,-6))
	{
		if(Math.abs(y)<Math.pow(10,-6))
			return 0;

		if(y>0)
			return 90;

		if(y<0)
			return 270};

		if (x>0)
		{
			if (y>=0)
				return 180*Math.atan(y/x)/Math.PI;

			if (y<0)
				return 180*Math.atan(y/x)/Math.PI-(-1)*360};

			if (x<0)
			{
				if (y>=0)
					return 180-180*Math.atan(-y/x)/Math.PI;

				if (y<0)
					return -180-(-1)*180*Math.atan(y/x)/Math.PI-(-1)*360
			}
		}
	}
}