[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-math] graphics, long function defs
From: |
Martin Rubey |
Subject: |
Re: [Axiom-math] graphics, long function defs |
Date: |
Wed, 15 Dec 2004 17:07:08 +0100 |
Dear Constantine,
* it would help a lot if you'd provide descriptive subject lines.
cf writes:
> (1) I tried to plot something but no plot window appeared:
>
> (20) -> draw(cos(t),t=0..%pi);
> Compiling function %E with type DoubleFloat -> DoubleFloat
> Graph data being transmitted to the viewport manager...
> AXIOM2D data being transmitted to the viewport manager...
>
> Type:
> TwoDimensionalViewport
>
> It was recommended to run sman but this is not an executable file on my
> system.
> There is a file sman.H1, but this seems to be a C header file. Can
> something be modified ??
Can't help here since I don't have graphics yet. Tomorrow, maybe. I think
without sman it won't work...
> (2) I tried to write the script testkinemat1.input (pasted below) like a
> function
> without input or output variables (see below) but this gave
> errors. Not clear what must be done ??
It might be that a function definition in an input file needs line
continuations on every line. Furthermore, a function definition in an input
file (i.e., if it is interpreted, rather than compiled) looks like
fun() == (statement1; statement2; statement3)
statement3 is the result of the function. Hence:
fun x == x; 1+1
will define a function (in fact, a so-called macro), that always returns x and
then evaluate the expression 1+1, giving 2. In this case, fun(x) will return x!
On the other hand,
fun x == (x; 1+1)
will define a function that always returns 2.
Applying this to your situation:
testkinemat1() == (_
_
Acon := matrix([[1, 0, Lo2*cos(phi)+Lo1*sin(phi), -sin(delta1)*a,0,0,0],_
[0, 1, Lo2*sin(phi)-Lo1*cos(phi), a*cos(delta1), 0, 0, 0],_
[0,1, Lo2*sin(phi)+Lo1*cos(phi), 0, a*cos(delta1), 0, 0],_
[1, 0,-Lo2*cos(phi)+Lo1*sin(phi), 0, 0, -sin(delta2)*a, 0],_
[0, 1,-Lo2*sin(phi)-Lo1*cos(phi), 0, 0, a*cos(delta2), 0],_
[1, 0,-Lo2*cos(phi)-Lo1*sin(phi), 0, 0, 0, -sin(delta2)*a],_
[0, 1, -Lo2*sin(phi)+Lo1*cos(phi), 0, 0, 0, a*cos(delta2)]]);_
_
detAcon:=determinant(Acon);_
_
detAcon:=simplify(detAcon))
It also seems, that such a macro definition doesn't like comments inbetween...
Martin