display of trig functions

Hi:

Concerning Maple 12 I note the following behavior:

cos(alpha-beta) displays as typed

cos(beta-alpha) displays as cos(alpha-beta)

Similarly,

sin(beta-alpha) is displayed as -sin(alpha-beta)

Anyone knows the xplanation for that and possibly how to prevent it from happening?

thanks a lot.

dimitrios

This is session dependent

In a fresh session I get instead:

cos(beta-alpha); 
                          cos(-beta + alpha)

cos(alpha-beta); 

                          cos(-beta + alpha)

This is due to automatic simplification to a (session dependent) unique representative form of these equivalent expressions. As this is at the basis of the design of Maple, I do not see very much to do against.

PS However, for display only purposes, you can use this empty name trick:

cos(alpha*``-beta); 
                         cos(alpha   - beta)

kludge

If it's just for display, you could use something like Cos(beta-alpha) .

 

with inert commands

Ie using the new '%' inertization prefix, and a function representation for `-`, some control on the display seems possible though:

eval(%cos(subs(m=`-`,m(beta,alpha))));

                          %cos(beta - alpha)

value(%);

                          cos(-beta + alpha)

improved kludge

Another possibility is

cos*(beta-alpha);
Robert Israel's picture

-beta+alpha

If you would rather see alpha - beta instead of -beta + alpha,

> sort(alpha - beta, [alpha]);

alpha-beta

This sorts the expression in decreasing powers of alpha.  Now (in the remainder of this session) whenever alpha - beta appears by itself or as an operand of an expression, it will be given in that form rather than as -beta + alpha.

You might also try

> cos(beta - alpha) := 'cos(beta-alpha)';

after which cos(beta-alpha) will stay as cos(beta-alpha).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}