Page 1 of 1

equation equal to zero

Unread postPosted: 14 Aug 2013, 04:16
by jmat
hi good evening, I have been looking for the manuals but can not find such an equation equal to zero with the Nspire
example

equation => a+b=c
result to obtain => a+b-c=0

Re: equation equal to zero

Unread postPosted: 14 Aug 2013, 13:36
by Laurae
substract right(E) to each part of the equation E (your a+b=c)

program to make :

yourfunctionname(eqloc)
set eq:=eqloc-right(eqloc)
Disp eq

To use it : yourfunctionname(eqloc)
example : yourfunctionname(a+b=c)
will display a+b-c=0
and also store in variable eq what is displayed

For a quick access to this, transform it to a function (not a program) and put it in MyLib, file without space or weird characters, and refresh libs, and it should appear on function libraries screen.

Re: equation equal to zero

Unread postPosted: 14 Aug 2013, 14:28
by jmat
Code: Select all
Define LibPub eqcero(equloc)=
Func
Local eq
eq:=equloc-right(equloc)
Disp eq
EndFunc


Thanks, I get an error

Re: equation equal to zero

Unread postPosted: 14 Aug 2013, 14:39
by Laurae
ok, forgot some functions are not available on functions instead of programs.
Edit : ok, forgot some functionnalities are not available on functions instead of programs.

Try this :

Code: Select all
Define LibPub eqcero(equloc)
Func
Return equloc-right(equloc)
EndFunc


(do the same steps for MyLib and libraries...)

to use it : eqcero(your equation)
If you want to store it for instance on variable blabla, use blabla:=eqcero(your equation)
To access the function use the libraries so you know what to type once you know what to type.

Should work fine (your function works perfectly, didn't test on the scratchpad however).

Re: equation equal to zero

Unread postPosted: 14 Aug 2013, 14:53
by Levak
Laurae wrote:ok, forgot some functions are not available on functions instead of programs.

What in the code is not available for functions ?
Local, Disp and assignations are available, as long as it operates on local variables.

Re: equation equal to zero

Unread postPosted: 14 Aug 2013, 15:01
by Laurae
Levak wrote:
Laurae wrote:ok, forgot some functions are not available on functions instead of programs.

What in the code is not available in Functions ?
Local, Disp and assignations are available, as long as it works on local variables.


Edited : "some functionnalities are not available on functions instead of programs"

He wants probably an output.

Re: equation equal to zero

Unread postPosted: 14 Aug 2013, 15:04
by Adriweb
Hmm, why not simply using left() and right() ... ?
It works with string() to format the ouput with what you want.

It can show "the steps", then :

Image

And you can even expr() what's in tmp2 to get an expression instread of a string, then.

Re: equation equal to zero

Unread postPosted: 14 Aug 2013, 15:13
by jmat
which method would be best?