0

I have this expression:

"98/25 * x1^3 * x2  +  28/5 * x1^2 * x2^2  +  98/25 * x1 * x2^3"

When I apply PrettyForm with Ryacas, I get:

cat(yac_str("PrettyForm(98/25 * x1^3 * x2  +  28/5 * x1^2 * x2^2  +  98/25 * x1 * x2^3)"))

            3     2          2     3          
x2 * 98 * x1    x2  * 28 * x1    x2  * 98 * x1
------------- + -------------- + -------------
     25               5               25      

I would prefer to have the numbers in each term at first position, and, if possible, to have x1 before x2.

Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225

1 Answers1

1

If you are looking for a solution for this specific case, then the following code below works for me. I just changed the order of the variables in the equation.


cat(yac_str("PrettyForm(x1^3*x2*298/25  +  x1^2 * x2^2 * 28/5  +  x1*x2^3* 98/25)"))

enter image description here.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Andy
  • 413
  • 2
  • 15