#include<iostream.h>
#include<conio.h>
#include<math.h>

void main()
{ double x1,x2,y1,y2,b,m,theta,d;
  clrscr();
  cout<<"Digite x1\n";
  cin>>x1;
  cout<<"Digite y1\n";
    cin>>y1;
  cout<<"Digite x2\n";
    cin>>x2;
  cout<<"Digite y2\n";
    cin>>y2;
  m=(y2-y1)/(x2-x1);
  b=-m*x1+y1;
  d=sqrt(pow((x2-x1),2)+pow((y2-y1),2));
  theta=atan(m);
  cout<<"m=";cout<<m;
  cout<<"\ny=";cout<<m;cout<<"x";
  if(b>0)
   cout<<"+";
  if(b<0)
   cout<<"-";
  if(b!=0)
   cout<<abs(b);
  cout<<"\nd=";cout<<d;
  cout<<"\ntheta=";cout<<180*theta/M_PI;cout<<" grados";

  getch();
}