GNU Emacs Calc is part of the GNU Emacs environment. I wish it had existed when I was young, because I would have used it a great deal. I once spent several days calculating a comet's orbit by hand. (This was all before computers entered my life.)
More recently, I have used GNU Emacs Calc to calculate a least squares linear regression; reading the documentation took more time than entering the data; and that, of course, took more time than the calculation itself.
I ended up with a clean result, that looked like this
y = 0.048 x^2 - 1.42 x
and on an automatically-produced graph, it overlay the raw data nicely.
Nowadays, I seldom do anything that involves mathematics.
Mainly, I use Emacs Calc to convert acres to hectares and BTU to joules. But if I had more reason to use it, one of my first actions would be to learn to use Calc Embedded mode. With this mode, you can stay in the buffer you are using for a different purpose, and use Calc.
For example, suppose you are writing a letter and you have this expression, which you want to solve for r:
0.6666-(4/15)*sqrt(10*pi^2*r^3/(D^2*G*m*epsilon)-1)
Place point on the same line as the expression,then type
M-# d
(I.e., press the ALT key and the # key at the same time, then press the d key.) This duplicates the expression. The fraction in it will be converted to decimal. To convert it back to a fraction, type
c F
You will note that the fractional parts are separated by a colon. This is because a `/' is the symbol used for division. When you enter a fraction, you must use a colon; otherwise you will confuse Calc. By default, calc shows fractional output the same way. However, you can specify the format to use for showing fractions on a line by typing
d o
and then the symbol you want, such as `/' (and then type RET, a `return', or `enter' to end the entry)
To convert the duplicated expression to Calc `Big' display mode, type
d B
Here is the result:
% [calc-mode: frac-format: ("/" nil)]
% [calc-mode: language: big]
____________________
| 2 3
3333 4 | 10 pi r
---- - -- | -------------- - 1
5000 15 | 2
\| D G m epsilon
For me, this `Big' representation is easier to read than the same expression shown all on one line.
To make the expression equal to zero, type
0 a =
Next, to solve for r type
a S
then specify r when asked (and, of course, type RET to end the entry)
The result produces this, in your mail buffer:
% [calc-mode: frac-format: ("/" nil)]
% [calc-mode: language: big]
2 1/3
0.898299259824 (G epsilon m D )
r = ----------------------------------
2/3
pi
Type q or M-# x to return to nromal.
To re-enter Calc Embedded mode, put the cursor over the expression and type M-# e
Return to: Notions
Or return to: Rattlesnake Home Page