5

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)

Vertex
  • 2,682
  • 3
  • 29
  • 43
  • The value of cos(pi) is -1 – Robert Harvey Apr 11 '13 at 19:10
  • @RobertHarvey, he knows ("I expect that Maxima simplifies `ex` to `-x`"). – zneak Apr 11 '13 at 19:11
  • 1
    The Maxima documentation shows a lot of expression manipulation functions [here](http://eagle.cs.kent.edu/MAXIMA/maxima_15.html). Trigsimp does painfully little to simplify that kind of expression. (Also, they use `%pi` instead of `pi`.) – zneak Apr 11 '13 at 19:13
  • 1
    Thank you! wxMaxima displays `pi` as the greek letter, so I supposed that this is the right constant. With `%pi` Maxima simplifies it correct without additional work :) – Vertex Apr 11 '13 at 19:41
  • @zneak, can you post your comment as an answer please? – Vertex Apr 12 '13 at 08:06

2 Answers2

9

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

zneak
  • 134,922
  • 42
  • 253
  • 328
3

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.

Community
  • 1
  • 1
quazgar
  • 4,304
  • 2
  • 29
  • 41