!!! fichier d'initialisation commun aux 8 premiers exercices !!!

## choix de la dimension
dd=!randitem 5,6,7,8,9
dimsList=3,3,3,4,3,$dd,3,$dd
dim=!item $exo of $dimsList

## choix de (dim-1) coordonnes
w0=
v0=
!for i=1 to $[$dim-1]
  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 
wn=!randitem -1,1

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

## fabrication de vecteurs 
vecw=!append item $wn to $w0
vecv=!append item $vn to $v0

vecx=
!for i=1 to $dim
  vecx=!append item x$i to $vecx
!next i

## permutation des coordonnes de w et v
sigma=!shuffle $dim
wbak=$vecw
vbak=$vecv
vecw=
vecv=
!for i=1 to $dim
  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

## plan ou hyperplan
!if $dim=3
  hypp=le plan 
 !else
  hypp=l'hyperplan
!endif
