QPI

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 603
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

QPI

Message par compsystems » sam. nov. 18, 2017 1:55 am

Idea: QPI is a very useful function, please can add this cmd thanks.

What name would you place?

I propose QPIRLN name from Q Quotient (fraction p/q) + or PI+ or ROOT+ or LN-e-

http://www.hpmuseum.org/forum/thread-9510.html


output pi
Image

output root
Image

output ln
Image

output e
Image

THE BEST NAME QPIRLN

compsystems
Messages : 603
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: QPI

Message par compsystems » sam. nov. 18, 2017 1:45 pm

Hello

A idea, a second argument that indicates what type of result awaits

QPI(expr) default function

case 1: qpirlne( expr, 0) -> Quotient with pi or root or ln or e

Q
case 2: qpirlne( expr, 1) if it does not find the equivalent to quotient without pi, root, ln, e, it returns the same value (input expr)
case 3: qpirlne( expr, 2) if it does not find the equivalent to quotient2 without pi, root, ln, e, it returns the same value (input expr)

PI
case 4: qpirlne( expr, 3) if it does not find the equivalent to PI, it returns the same value (input expr)

ROOT
case 4: qpirlne( expr, 4) if it does not find the equivalent to root, it returns the same value (input expr)

LN
case 5: qpirlne( expr, 5) if it does not find the equivalent to ln, it returns the same value (input expr )

e
case 6: qpirlne( expr, 6) if it does not find the equivalent to e, it returns the same value (input expr )

within a program it is required to express a decimal number in various formats


[php]ex0:

qpirlne( (2*π/3)+(3*π/4) , 0) -> 17/12*π

qpirlne( (2*π/3)+(3*π/4) , 1) -> 1137949/255685 // Q1

qpirlne( (2*π/3)+(3*π/4) , 2) -> 4+(115209/255685) // Q2

qpirlne( (2*π/3)+(3*π/4) , 3) -> 17/12*π // PI

qpirlne( (2*π/3)+(3*π/4) , 4) -> (2*π/3)+(3*π/4) // ROOT

qpirlne( (2*π/3)+(3*π/4) , 5) -> (2*π/3)+(3*π/4) // LN

qpirlne( (2*π/3)+(3*π/4) , 6) -> (2*π/3)+(3*π/4) // e

ex1:

qpirlne( LN(3*π)-LN(√(5)), 0) -> LN( (3*π*√(5)/5) )
qpirlne( LN(3*π)-LN(√(5)), 1) -> 55715/38728 // Q1
qpirlne( LN(3*π)-LN(√(5)), 2) -> 1+(16987/38728) // Q2
qpirlne( LN(3*π)-LN(√(5)), 3) -> LN( (3*π*√(5)/5) ) // PI
qpirlne( LN(3*π)-LN(√(5)), 4) -> LN( (3*π*√(5)/5) ) // ROOT
qpirlne( LN(3*π)-LN(√(5)), 5) -> LN( (3*π*√(5)/5) ) // LN
qpirlne( LN(3*π)-LN(√(5)), 6) -> LN(3*π)-LN(√(5)) // e

ex2:

qpirlne( LN((2/5))-LN(√(2)), 0) -> -LN((25/2))/2
qpirlne( LN((2/5))-LN(√(2)), 1) -> -116599/92329 // Q1
qpirlne( LN((2/5))-LN(√(2)), 2) -> -1+(-24270/92329) // Q2
qpirlne( LN((2/5))-LN(√(2)), 3) -> LN((2/5))-LN(√(2)) // PI
qpirlne( LN((2/5))-LN(√(2)), 4) -> LN((2/5))-LN(√(2)) // ROOT
qpirlne( LN((2/5))-LN(√(2)), 5) -> -LN((25/2))/2 // LN
qpirlne( LN((2/5))-LN(√(2)), 6) -> LN((2/5))-LN(√(2)) // e

ex3:

qpirlne( e^(2*π/(3*√(7))), 0) -> e^((2*π*√(7)/21))
qpirlne( e^(2*π/(3*√(7))), 1) -> 224192/101585 // Q1
qpirlne( e^(2*π/(3*√(7))), 2) -> 1+(21022/101585) // Q2
qpirlne( e^(2*π/(3*√(7))), 3) -> e^(2*π/(3*√(7))) // PI
qpirlne( e^(2*π/(3*√(7))), 4) -> e^(2*π/(3*√(7))) // ROOT
qpirlne( e^(2*π/(3*√(7))), 5) -> e^(2*π/(3*√(7))) // LN
qpirlne( e^(2*π/(3*√(7))), 6) -> e^(2*π/(3*√(7))) // e


ex4:

qpirlne( 7*π/√(90), 0) -> 7*π*√(10)/30

qpirlne( 7*π/√(90), 1) -> 171470/73971

qpirlne( 7*π/√(90), 2) -> 260521/112387

qpirlne( 7*π/√(90), 3) -> 7*π/√(90)


ex5:

qpirlne( 1/(3+i*√(3)), 0) -> (1/4)-i*((√(3)/12))
qpirlne( 1/(3+i*√(3)), 1) -> (1/4)-(1/4)*i*√(1/3) // Q1
qpirlne( 1/(3+i*√(3)), 2) -> (1/4)-(i*37829/262087) // Q1
qpirlne( 1/(3+i*√(3)), 3) -> 1/(3+i*√(3)) // PI
qpirlne( 1/(3+i*√(3)), 4) -> (1/4)-i*((√(3)/12)) // ROOT
qpirlne( 1/(3+i*√(3)), 5) -> 1/(3+i*√(3)) // LN
qpirlne( 1/(3+i*√(3)), 6) -> 1/(3+i*√(3)) // e

ex ...:
SIN((π/8))
SIN((π/10))
COS((π/12))
COS((3*π/4))
ACOS((-1/2))
[/php]
Dernière modification par compsystems le dim. nov. 19, 2017 2:47 pm, modifié 1 fois.

parisse
Messages : 5882
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: QPI

Message par parisse » sam. nov. 18, 2017 2:12 pm

You have all the tools to program this, now just do it:-)

compsystems
Messages : 603
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: QPI

Message par compsystems » sam. nov. 18, 2017 11:08 pm

Yes, that's true can be programmed externally, but the idea is that when you install XCAS on a computer anywhere, be it at a university, school, event, conference, etc. I do not have to load my custom functions, everything must be integrated, pre-installed, transparent for the user and more for a beginner user. We are in a modern era in which every time we use a computer room, we download and install an application, and we do not load libraries, we do not configure, everything must be ready, at the moment of using it.

In the case of QPI, I see that it is a very good function to be preincluded in the kernel of the symbolic engine of Xcas.

parisse
Messages : 5882
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: QPI

Message par parisse » dim. nov. 19, 2017 7:07 am

I said "just do it!", because I believe that once you will have programmed something not too easy, you will have a better understanding on the work required and maybe you will bring less suggestions on what *I* should program...

Répondre