public class FORMAT  
{
public static void main(String[] args)
{
Point a=new Point(1,0),b=new Point(1,1),c=new Point(0,1),d=new Point(2,2);
Beeline ln1=new Beeline(1,1,1),ln2;
(ln2=ln1.vertical(a)).print();
System.out.println(ln2.passPoint(new Point(0,-1)));
(new Point(-1,0)).line(new Point(1,1)).intersection(ln2).print();
new Beeline(1,-1,0).intersection(new Beeline(0,1,10)).print();
}
}
class Point  
{
public final static Point origin=new Point(0,0);//原点
private double x,y;
public Point()
{
x=y=0;
}
public Point(double a,double b)
{
x=a;y=b;
}
public double getx()
{
return x;
}
public double gety()
{
return y;
}
public double distance(Point u)
{
double s= x-u.x , t= y-u.y;
return Math.sqrt(s*s+t*t);
}
public boolean online (Beeline ln)//返回true,当且仅当当前point在直线ln上
{
//提示:等价于直线ln通过当前点
}
public Beeline line(Point other)//返回经过当前点和点other的直线
{
//提示:经过A(x0,y0)和B(x1,y1)的直线方程是: (y1-y0)x-(x1-x0)y+x1*y0-y1*x0=0
}
public void print(){System.out.println("("+x+" , "+y+")");}
}class Beeline  
{
private double a,b,c;//ax+by+c=0
public Beeline(double u,double v,double w)
{a=u;b=v;c=w;}
public boolean passPoint(Point p)
{
return Math.abs(a*p.getx()+b*p.gety()+c)<0.00000000001;
}
public Point intersection(Beeline that)//求两条直线的交点,即解二元一次方程组。
{
//提示:方程组a1x+b1y+c1=0,a2x+b2y+c2=0的解是
//x=(b1*c2-c1*b2)/(a1*b2-b1*a2),y=(a2*c1-a1*c2)/(a1*b2-b1*a2)
}
public Beeline vertical(Point x)//返回经过点x,与当前直线垂直的直线
{
//实现这个方法
}
public void print()
{
String s="";
if(a!=0)
{
if(a==1)s+="x";
else
if(a==-1)s+="-x";
else s+=a+"x";
}
if(b!=0)
{
if(b==1)s+="+y";
else
if(b==-1)s+="-y";
else  
if(b>0)s+="+"+b+"y";
else s+=b+"y";
}
if(s.length()==0)
if(c!=0)s="直线方程x,y系数为0,常数项不为0!";
else s="0=0";
else  
if(c==0)s+="=0";
else if(c<0) s+=c+"=0";
else
s+="+"+c+"=0";  
System.out.println(s);
}
}