Post Reply 
Equation of Tangent
12-08-2021, 02:06 PM
Post: #13
RE: Equation of Tangent
This one might work better, but it's more complicated:

Code:

EXPORT TANGENT()
BEGIN
 LOCAL a, f, df, b, fn, ff, sf;
 PRINT;
 INPUT (fn, "Function:", "f (X) =", "Enter the algebraic expression");
 CASE
  IF fn==1 THEN
   F1▶f;
   diff(F1(X),'X',1)▶df;
  END;
  IF fn==2 THEN
   F2▶f;
   diff(F2(X),'X',1)▶df;
  END;
  IF fn==3 THEN
   F3▶f;
   diff(F3(X),'X',1)▶df;
  END;
  IF fn==4 THEN
   F4▶f;
   diff(F4(X),'X',1)▶df;
  END;
  IF fn==5 THEN
   F5▶f;
   diff(F5(X),'X',1)▶df;
  END;
  IF fn==6 THEN
   F6▶f;
   diff(F6(X),'X',1)▶df;
  END;
  IF fn==7 THEN
   F7▶f;
   diff(F7(X),'X',1)▶df;
  END;
  IF fn==8 THEN
   F8▶f;
   diff(F8(X),'X',1)▶df;
  END;
  IF fn==9 THEN
   F9▶f;
   diff(F9(X),'X',1)▶df;
  END;
  IF fn==0 THEN
   F0▶f;
   diff(F0(X),'X',1)▶df;
  END;
 DEFAULT
  RETURN "error";
 END;
 INPUT (a, "Study of the tangent at x =?", " X =");
 PRINT ("f (X) =" + f);
 PRINT ("Equation of the tangent at " + a + " :");
 EXPR(REPLACE(STRING(df), "X", STRING(a)))▶sf;
 EXPR(REPLACE(STRING(f), "X", STRING(a)))▶ff;
 PRINT ("Y =" + sf + "(X -" + a + ") +" + ff);
 −sf * a + ff ▶ b;
 PRINT ("that is: Y =" + sf + IFTE(b<0,"X -","X +") + ABS(b));
END;

-road
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Equation of Tangent - vjc - 11-02-2021, 05:46 PM
RE: Equation of Tangent - roadrunner - 11-03-2021, 03:13 PM
RE: Equation of Tangent - vjc - 11-04-2021, 02:52 AM
RE: Equation of Tangent - roadrunner - 11-04-2021, 12:35 PM
RE: Equation of Tangent - vjc - 11-05-2021, 01:05 AM
RE: Equation of Tangent - vjc - 11-09-2021, 06:33 AM
RE: Equation of Tangent - vjc - 11-12-2021, 10:07 PM
RE: Equation of Tangent - roadrunner - 11-18-2021, 11:51 PM
RE: Equation of Tangent - vjc - 11-29-2021, 07:42 AM
RE: Equation of Tangent - roadrunner - 11-29-2021, 07:33 PM
RE: Equation of Tangent - vjc - 12-01-2021, 05:28 AM
RE: Equation of Tangent - vjc - 12-01-2021, 05:30 AM
RE: Equation of Tangent - roadrunner - 12-08-2021 02:06 PM
RE: Equation of Tangent - vjc - 12-16-2021, 09:21 PM
RE: Equation of Tangent - RobbiOne - 12-19-2021, 11:28 PM



User(s) browsing this thread: 8 Guest(s)