Rev 6055 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 539 | bpr | 1 | !goto $wims_read_parm |
| 2 | |||
| 3 | :def |
||
| 4 | title=Racines complexes |
||
| 5 | synonyme=racines d'un nombre complexe, nombre complexe racines |
||
| 6 | input=function |
||
| 7 | !exit |
||
| 8 | |||
| 9 | :proc |
||
| 10 | !bound order between integer 2 and 100 default 2 |
||
| 11 | !if x isvarof $formula |
||
| 12 | error=bad_formula |
||
| 13 | !exit |
||
| 14 | !endif |
||
| 6553 | bpr | 15 | formula=!rawmath $formula |
| 539 | bpr | 16 | result=!exec pari print(polroots(x^$order-($formula))~) |
| 17 | result=!declosing $result |
||
| 18 | result=!trim $result |
||
| 19 | result=!replace internal , by , $ in $ $result |
||
| 20 | result=!replace internal $ 0.0 + 0.0*I by 0 in $result |
||
| 21 | result=!replace internal $ 0.0 + by $ in $result |
||
| 22 | result=!replace internal $ 0.0 - by $ - in $result |
||
| 23 | result=!replace internal $ + 0.0*I by $ in $result |
||
| 24 | result=!replace internal $ - 0.0*I by $ in $result |
||
| 25 | result=!singlespace $result |
||
| 26 | !exit |
||
| 27 | |||
| 28 | :output |
||
| 29 | Racines |
||
| 30 | !if $order<=5 |
||
| 31 | !item $order-1 of carrées, cubiques, quartiques, quintiques |
||
| 32 | !else |
||
| 33 | $order-ièmes |
||
| 34 | !endif |
||
| 35 | complexes de |
||
| 36 | !htmlmath $formula |
||
| 37 | $ : |
||
| 38 | !endif |
||
| 6553 | bpr | 39 | |
| 539 | bpr | 40 | !set n=!itemcnt $result |
| 6553 | bpr | 41 | <ul> |
| 539 | bpr | 42 | !for i=1 to $n |
| 43 | !set l=!item $i of $result |
||
| 6553 | bpr | 44 | <li>\(r_$i\)= |
| 539 | bpr | 45 | !htmlmath $l |
| 6553 | bpr | 46 | </li> |
| 539 | bpr | 47 | !next i |
| 6553 | bpr | 48 | </ul> |
| 539 | bpr | 49 | !exit |
| 50 |