package liceum28;
import java.awt.*;
public class _3d
{
public static double sa,ca,sf,cf;
public static pkt3d k_3d=new pkt3d(0,0,0);
//------------------------------------------------------------
public static void rzutowanie(int alfa,int fi)
{double alfa_=alfa*Math.PI/180;
double fi_=fi*Math.PI/180;
sa=Math.sin(alfa_);
ca=Math.cos(alfa_);
sf=Math.sin(fi_);
cf=Math.cos(fi_);
}
//------------------------------------------------------------
public static pkt3d p3d(double a,double b,double c)
{
return(new pkt3d(a,b,c));
}
//------------------------------------------------------------
public static pkt2d rzut(pkt3d p)
{
return(new pkt2d(p.y*sa+p.x*ca,(p.y*ca-p.x*sa)*sf+p.z*cf));
}
//------------------------------------------------------------
public static void punkt(Graphics g,pkt3d p)
{
lo28.punkt(g,rzut(p));
}
//------------------------------------------------------------
public static void pisz(Graphics g,pkt3d p,String zd)
{
lo28.pisz(g,rzut(p),zd);
}
//------------------------------------------------------------
public static void kropka(Graphics g,pkt3d p,Color kolor)
{
lo28.kropka(g,rzut(p),kolor);
}
//------------------------------------------------------------
public static void linia(Graphics g,pkt3d p,pkt3d k)
{
lo28.linia(g,rzut(p),rzut(k));
k_3d.war(k.x,k.y,k.z);
}
//------------------------------------------------------------
public static void kursor(Graphics g,pkt3d p)
{
k_3d.war(p.x,p.y,p.z);
}
//------------------------------------------------------------
public static void kreska(Graphics g,pkt3d k)
{
linia(g,k_3d,k);
k_3d.war(k.x,k.y,k.z);
}
}
|