public class dogru3
{
    // 3 boyutlu dogru
    nokta3 n1;
    nokta3 n2;

    public dogru3()
    {
        n1=new nokta3();
        n2=new nokta3();
    }

    public dogru3(double n1x, double n1y,double n1z,
                  double n2x, double n2y,double n2z)
    {
        n1=new nokta3(n1x,n1y,n1z);
        n2=new nokta3(n2x,n2y,n2z);
    }

    public dogru3(nokta3 na,nokta3 nb)
    {
        n1=new nokta3(na.Xoku(),na.Yoku(),na.Zoku());
        n2=new nokta3(nb.Xoku(),nb.Yoku(),nb.Zoku());
    }

    public void dogru3gir(double x1, double y1,double z1,
                          double x2, double y2,double z2)
    {
        n1.nokta3gir(x1,y1,z1);
        n2.nokta3gir(x2,y2,z2);
    }

    public void dogru3gir(nokta3 in1, nokta3 in2 )
    {
        n1.nokta3gir(in1.x,in1.y,in1.z);
        n2.nokta3gir(in2.x,in2.y,in2.z);
    }

    public void n1gir(double x1,double y1,double z1)
    {
       n1.nokta3gir(x1,y1,z1);  
    }

    public void n1gir(nokta3 in1)
    {
       n1.nokta3gir(in1.x,in1.y,in1.z);  
    }

    public void n2gir(double x2,double y2,double z2)
    {
       n2.nokta3gir(x2,y2,z2);  
    }

    public void n2gir(nokta3 in2)
    {
       n2.nokta3gir(in2.x,in2.y,in2.z);  
    }

    public nokta3 n1oku()
    {
      return n1;
    }

    public nokta3 n2oku()
    {
      return n2;
    }

    public double X()
    {
      //dogrunun x koordinat uzunlugu
      return (n2.Xoku()-n1.Xoku()); 
    }

    public double Y()
    {
      //dogrunun y koordinat uzunlugu
      return (n2.Yoku()-n1.Yoku()); 
    }

    public double Z()
    {
      //dogrunun z coordinat uzunlugu
      return (n2.Zoku()-n1.Zoku()); 
    }

    public double ac¨_n1_xy()
    {
      //dogrunun n1 noktas¨ndan x y duzlemindeki ac¨s¨
      return Math.atan2(Y(),X());
    }

    public double ac¨_n1_xz()
    {
      // dogrunun n1 noktas¨ndan x z duzlemindeki ac¨s¨
      // radyan
      return Math.atan2(Z(),X());
    }

    public double ac¨_n1_yz()
    {
      //dogrunun n1 noktas¨ndan y z duzlemindeki ac¨s¨
      //radyan
      return Math.atan2(Z(),Y());
    }

    public double R()
    {
      //dogrunun boyu
      return Math.sqrt(X()*X()+Y()*Y()+Z()*Z());
    }

    public String toString()
    {
        return "n1: "+n1.toString()+"n2: "+n2.toString();
    }
}
