01-20-2021, 09:05 PM
Hi!
I'm just trying to get the distance between 2 points and show the result in exact format, nothing fancy.... all I get is an "r" as a result. I'm using the latest version of the HP Primie Emulator.
My Code:
[attachment=9037]
I'm just trying to get the distance between 2 points and show the result in exact format, nothing fancy.... all I get is an "r" as a result. I'm using the latest version of the HP Primie Emulator.
My Code:
Code:
EXPORT DBTP()
BEGIN
LOCAL a:=0,b:=0,c:=0,d:=0,r:=0;
PRINT();
INPUT({{a,[0],{10,20,1}},{b,[0],{40,20,1}},{c,[0],{10,20,2}},{d,[0],{40,20,2}}},"Distance between 2 Points",{"X₁:","Y₁:","X₂:","Y₂:"},{"Input a value for X₁ (Real number).","Input a value for Y₁ (Real number).","Input a value for X₂ (Real number).","Input a value for Y₂ (Real number)."});
IF 0 THEN BREAK;
END;
r:=√((c-a)^2+(d-b)^2);
r:=exact(r);
PRINT("
Distance between points:
"+r);
END;