!!! fichier d'initialisation commun aux exercices  11 et 12 !!!

## choix de 2 coordonnes
w0=
v0=
!for i=1 to 2
  x=!randint -7,7
  y=!randint -7,7
  w0=!append item $x to $w0
  v0=!append item $y to $v0
!next i

## choix d'une dernire coordonne 
w3=!randitem -1,1

v3=(-1/$w3)*([$w0] . transpose([$v0]))
v3=!exec maxima $v3;

## fabrication de vecteurs 
vecw=!append item $w3 to $w0
vecv=!append item $v3 to $v0

vecx=x,y,z

## permutation des coordonnes de w et v
sigma=!shuffle 3
wbak=$vecw
vbak=$vecv
vecw=
vecv=
!for i=1 to 3
  ind=!item $i of $sigma
  x=!item $ind of $wbak
  y=!item $ind of $vbak
  vecw=!append item $x to $vecw
  vecv=!append item $y to $vecv
!next i

## fabrication de l'quation d''un plan
c1=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
c2=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
L=expand(($c1)*[$vecv]+($c2)*[$vecw])
eqH=$L . transpose([$vecx])

## paramtres calculant la bonne matrice
a=!item 1 of $vecv
b=!item 2 of $vecv
c=!item 3 of $vecv

vecL=!exec maxima $L;
vecL=!declosing $vecL

l1=!item 1 of $vecL
l2=!item 2 of $vecL
l3=!item 3 of $vecL

norm=($c1)*(($a)^2+($b)^2+($c)^2)


## vecteurs pour affichage
vecv=!texmath $vecv
vecv=\(v=($vecv))
vecx=\(($vecx))
