import java.awt.*;
import java.awt.event.*;
class game0417 extends Frame{
int m,n;
int mxs,nxs;
int mapm[][]=new int[101][101];
int mapn[][]=new int[101][101];
public static void main(String [] args) {
Frame f=new game0417();
f.setTitle("game0417");
f.setSize(700,700);
f.setBackground(Color.yellow);
f.setVisible(true);
}
game0417(){
mxs=50;
nxs=40;
for(m=0;m<101;m++){
for(n=0;n<101;n++){
mapm[m][n]=seekmapm(kakudo,m,n,ms,ns);
mapn[m][n]=seekmapm(kakudo,m,n,ms,ns);
}
}
addWindowListener(new stopwin());
}
class stopwin extends WindowAdapter{
public void windowClosing(WindowEvent we){System.exit(0);}
}
public void paint(Graphics g){
}
public static int seekmapm(double kakudo,int m,int n,int ms,int ns){
int m1,n1,m2,n2;
m1=m-ms;
n1=n-ns;
m2=rotx(kakudo,m1,n1);
n2=roty(kakudo,m1,n1);
return (int)m2+ms;
}
public static int seekmapn(double kakudo,int m,int n,int ms,int ns){
int m1,n1,m2,n2;
m1=m-ms;
n1=n-ns;
m2=rotx(kakudo,m1,n1);
n2=roty(kakudo,m1,n1);
return (int)n2+ns;
}
public static double rotx(double kakudo,int x,int y){
double kaku;
double a1,a2,a3,a4;
double x1,y1;
kaku = kakudo*Math.PI/180;
a1=Math.cos(kaku);
a2=-Math.sin(kaku);
a3=Math.sin(kaku);
a4=Math.cos(kaku);
x1=a1*x+a2*y;
y1=a3*x+a4*y;
return x1;
}
public static double roty(double kakudo,double x,double y){
double kaku;
double a1,a2,a3,a4;
double x1,y1;
kaku = kakudo*Math.PI/180;
a1=Math.cos(kaku);
a2=-Math.sin(kaku);
a3=Math.sin(kaku);
a4=Math.cos(kaku);
x1=a1*x+a2*y;
y1=a3*x+a4*y;
return y1;
}
}
最終更新:2011年02月22日 05:30