Salut! Acesta este algoritmul pentru c++:
#include<iostream.h>
#include<math.h>
void main()
{
int d,a,b,c,x,y,B;
float D;
cout<<"coordonate dreapta"<<endl;
cout<<"a=";
cin>>a;
cout<<"b=";
cin>>b;
cout<<"c=";
cin>>c;
cout<<"coordonate punct"<<endl;
cout<<"x=";
cin>>x;
cout<<"y=";
cin>>y;
cout<<"distanta de la puct la dreapta este:";
D=((a*x+b*y+c)/sqrt(a*a+b*b));
cout<<D;
}