HP Forums
USE OF EXPR() COMMAND - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: USE OF EXPR() COMMAND (/thread-22130.html)



USE OF EXPR() COMMAND - Victorcastrejon - 08-05-2024 05:45 PM

Hi, this program calculates the equation of a straight line passing through two points.
I am not able to get the equation to appear in the command line without the quotation marks at the beginning and at the end of the equation.
Can someone help me to remove the quotation marks?
Thank you,
Victor
EXPORT RECTA2DET()
BEGIN
// Asegurarse de que estamos en el modo CAS y declarar las variables locales
LOCAL M1,detM1,x1,y1,x2,y2,q;

INPUT({{x1,[0],{30,20,0}},{y1,[0],{60,20,0}},{x2,[0],{30,20,1}},{y2,[0],{60,20,1}}},{"Introducir A1(x1,y1) y A2(x2,y2)"});

// Definición de la matriz simbólica M1 usando el entorno CAS
M1:= CAS("[[x2-x1,y2-y1],[x-x1,y-y1]]");

// Calcular el determinante de la matriz M1 en el entorno CAS
detM1:= CAS("det(M1)");

// Mostrar la ecuacion general de la recta y retornarla a la linea de comandos para un uso posterior si es necesario
q:= detM1+"=0";
PRINT("Ecuacion gral. de la recta: "+q);
RETURN (EXPR("q"));

END;