!!! fichier d'initialisation de l'exo 3 !!!

## lecture du fichier commun
!read commonDir/common1


## fabrication d'un polynome de la variable t
k1=!randint -7,7
k2=!randint 1,9
polyq=expand((t-($k1))^2-($k2))
t1=($k1)-(sqrt($k2))
t2=($k1)+(sqrt($k2))

## fabrication de formes linaires et de ut (ne dpend pas de t)
q=!randint 1,3
c1=!randint 1,5
c2=!randint 1,5

vech=expand(($polyq)*[$vecw]+($q)*[$vecv])
eqH=($vech) . transpose([$vecx])
vecL=($c1)*[$vecw]+($c2)*[$vecv]
vecw=($vecw)

k=!randint -7,7
!if $k=0
  k=!randitem -3,3
!endif
!if $k>0
  ut=!texmath f(x)=L(x)\cdot w + $k x
 !else
  ut=!texmath f(x)=L(x)\cdot w $k x
!endif

## appel  maxima
t3=($k1)-(sqrt(($k2)+(($c1)*($q)/($c2))))
t4=($k1)+(sqrt(($k2)+(($c1)*($q)/($c2))))
polyp=expand((t-($t1))*(t-($t2))*(t-($t3))*(t-($t4)))

tmpexec=!exec maxima $eqH;\
($vecL) . transpose([$vecx]);\
$polyp;\
($t1);\
($t2);\
($t3);\
($t4);

!distribute lines $tmpexec into eqH,formL,polyp,t1,t2,t3,t4

## pour affichage
eqH=!texmath $eqH=0
eqH=\($eqH)
formL=!texmath $formL
formL=\(L(x)= $formL)
vecx=!texmath ($vecx)
vecx=\($vecx)
ut=\($ut)

goodrep=$t1, $t2, $t3, $t4



