private static double sinpi(double x){
		int res=48;
		if(sinmap==null){
			sinmap=new double[res+1];
			for(int i=0;i<=res;i++) sinmap[i]=Math.sin(Math.PI*i/res/2);
		}
		x-=2*Math.floor(x/2);
		int mul=1;
		if(x>=1){mul=-1;x-=1;}
		if(x>.5){x=1-x;}
		if(x>=.5) return mul;
		if(x<=0) return 0;
		x*=2*res;
		int y=(int)x;
		x-=y;
		return mul*(sinmap[y]+(sinmap[y+1]-sinmap[y])*x);
	}