I'am new to Maxima and would like to use it for Denavit-Hartenberg matrices (consists of a lot of cos and sin terms). The problem is, that maxima does not simplify the following expression:

ex: x*cos(pi);

I expect, that Maxima simplifies ex to -x. How can this been done? (ratsimp(ex) and trigsimp(ex) have no effects)

有帮助吗?

解决方案

In Maxima's dialect, the correct name of the constant is %pi. With it, it should simplify correctly.

其他提示

As others have said, %pi is the correct name of the constant in Maxima. pi is simply rendered as π in GUIs like wxMaxima because all Greek letters are (you can have a variable named "π", which has nothing to do with the value of the constant π=3.14159...).

By the way, other predefined constants are written with the % character as well, such as for example

%e (=exp(1))
%i (=sqrt(-1))
%phi (the golden section)

The manual's index lists all % candidates.

Note that other useful constants that can not be expressed by digits, such as inf or false do not have the percent character.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top