how to calculate distance between two points..
each point have a coordinates (x,y).
See if this help :
Program CalculateDistance; Uses WinCrt; var x1,x2,y1,y2:integer; d:real; begin Writeln; Write('Input A (X1): ');readln(x1); Write('Input B (X2): ');readln(x2); Write('Input A (Y1): ');readln(y1); Write('Input B (Y2): ');readln(y2); d:=sqrt(sqr(x2-x1)+sqr(y2-y1)); Writeln; Writeln('Distance between A and B is: ',d:4:2); end.
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.