public double cos(int a){
		//normalizing
		if(a>360){
			a %= 360;
		}else if(a<0){
			a %= 360;
			a += 360;
		}

		//return
		if(a <= 90){
			return cos[a];
		}else if(a <= 180){
			return -cos[180 - a];
		}else if(a <= 270){
			return -cos[a - 180];
		}else{
			return cos[360 - a];
		}
	}