Page 1 of 3

[SOLVED]Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 00:45
by AlexisVieira
Hi, every time i want to pass a number complexe writted in algebric mode (a+bi) to trigonometric mode (p*cis(x)) i need to use the abs() and angle() function, so this afternoon i tried to make a function/program that do this 2 steps in one
something like:
Code: Select all
Define .... trigo(x)
...
Return abs(x) *cis(angle(x))
End...

note that on my nspire i always have "cis" defined (define cis(x)=cos(x)+i*sin(x)) so the program should work even when i have the cis() defined...

if someone can help me with this...
btw, i want this to a ti-84 too...

Re: Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 00:51
by Levak
AlexisVieira wrote:if someone can help me with this...

I cannot see any question ?

Re: Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 00:51
by AlexisVieira
Levak wrote:
AlexisVieira wrote:if someone can help me with this...

I cannot see any question ?


that function doesn't work... i need someone to fix it...

Re: Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 00:57
by Levak
AlexisVieira wrote:that function doesn't work... i need someone to fix it...

By defined everywhere, do you mean defined in MyLib ?
Are you sure the rest of the code is not usefull ?
What is the error ?

Re: Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 01:01
by AlexisVieira
Levak wrote:
AlexisVieira wrote:that function doesn't work... i need someone to fix it...

By defined everywhere, do you mean defined in MyLib ?
Are you sure the rest of the code is not usefull ?
What is the error ?


i want a libpub function that when i tipe file/function(2i) the nspire answer me "2cis(pi/2)"
the "..." is that "prgrm" or "function", that (bad) exemple only have that one line of code...

Re: Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 01:03
by Adriweb
I believe that on TI's CAS, you can't make it so that that a calculation will return an expression in terms of a user-defined one.

It'd be great, though.

(At least not in non-native ways.)

Re: Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 01:06
by Levak
AlexisVieira wrote:i want a libpub function that when i tipe file/function(2i) the nspire answer me "2cis(pi/2)"
the "..." is that "prgrm" or "function", that (bad) exemple only have that one line of code...

Oh, I see, but no you can't.
The CAS engine stops on primitives, and functions are not primitive, only stuff like cos(), sin(), exp() etc ... are.

Re: Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 01:08
by AlexisVieira
Adriweb wrote:I believe that on TI's CAS, you can't make it so that that a calculation will return an expression in terms of a user-defined one.

It'd be great, though.

(At least not in non-native ways.)


well, i think that it's possible on the CAS oS... i was trying lots of times today and it returned me something aproximated of that that i want...
on the non-CAS it will be more complicated because it will return the angle in RAD, so the solution could be something like "angle(x)/pi" and a "pi" writte after...

Re: Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 01:10
by AlexisVieira
Levak wrote:
AlexisVieira wrote:i want a libpub function that when i tipe file/function(2i) the nspire answer me "2cis(pi/2)"
the "..." is that "prgrm" or "function", that (bad) exemple only have that one line of code...

Oh, I see, but no you can't.
The CAS engine stops on primitives, and functions are not primitive, only stuff like cos(), sin(), exp() etc ... are.


and you can do that for a non-CAS nspire?

on the cas maybe i can make it displays the angle and the module on diferent lines...

Re: Function algébric-->trigonometic

Unread postPosted: 19 Jun 2013, 01:12
by Levak
AlexisVieira wrote:on the cas maybe i can make it displays the angle and the module on diferent lines...

Like returning lists/matrices ?