\title{Distancia de un punto a un plano 2}
\language{fr}
\range{-5..5}
\author{Bernadette PERRIN-RIOU}
\email{bpr@math.u-psud.fr}
\computeanswer{yes}
\format{html}
\precision{10000}
\integer{a=randint(-10..10)}
\integer{b=randint(-10..10)}
\integer{c=randint(-10..10)}

\integer{a1=randint(-5..5)}
\integer{b1=randint(-5..5)}
\integer{c1=randint(-1..1)}

\integer{a2=randint(-5..5)}
\integer{b2=randint(-5..5)}
\integer{c2=randint(-1..1)}
\integer{a2= \a2=\a1 and \b2=\b1 and \c2=\c1 ? \a2-1}

\integer{a3=randint(-5..5)}
\integer{b3=randint(-5..5)}
\integer{c3=randint(-5..5)}
\text{QR= \a2-(\a1),\b2-(\b1),\c2-(\c1)}
\text{QS= \a3-(\a1),\b3-(\b1),\c3-(\c1)}
\text{test= (\a2-(\a1))*(\b3-(\b1))=(\a3-(\a1))*(\b2-(\b1))
and  (\a3-(\a2))*(\b1-(\b2))=(\a1-(\a2))*(\b3-(\b2))
and  (\a1-(\a3))*(\b2-(\b3))=(\a2-(\a3))*(\b1-(\b3)) ? 
1:2}
\text{choix= una recta,un plano}
\text{sol1= item(\test,\choix)}
\text{QP= \a-(\a1),\b-(\b1),\c-(\c1)}
\text{QS= \sol1=1 ? \QP}
\real{num= ((item(2,\QR))*(item(3,\QS))-(item(3,\QR))*(item(2,\QS)))^2
+((item(3,\QR))*(item(1,\QS))-(item(1,\QR))*(item(3,\QS)))^2
+((item(1,\QR))*(item(2,\QS))-(item(2,\QR))*(item(1,\QS)))^2}
\if{\sol1=1}{
  \real{sol2=((\num)/(item(1,\QR))^2+(item(2,\QR))^2+(item(3,\QR))^2)^(1/2)}
  }
  {\matrix{M= \QR
  \QS
  \QP}
  \real{sol2=abs(det(\M))/(\num)^(1/2)}
}

\steps{choice 1
reply 1
}
\statement{
Soit \(Q = (\a1 , \b1 , \c1)) ,  \(R = (\a2 , \b2 , \c2)) ,  
\(S = (\a3 , \b3 , \c3)). 
\if{\step <= 1}{ Los puntos \(Q), \(R) et \(S)  definen \embed{choice 1}}
\if{\step=2}{Calcular la distancia del punto \(P = (\a , \b , \c) )
\if{\test=2}{al plano que contiene a los puntos \(Q), \(R ) y \(S).}
\if{\test=1}{a la recta que contiene a los puntos \(Q), \(R) et \(S).}
}}
\choice{}{\sol1}{\choix}
\answer{distancia}{\sol2}{type=numeric}

\hint{\if{\step=2 and \test=2}{
La distancia de un punto \(P) al plano determinado por tres puntos \(Q), \(R) et \( S) puede calcularse mediante la fórmula
<center>  \(\frac{ |\vec{QR}.(\vec{QS}\wedge \vec{QP})||}{|| \vec{QR}\wedge \vec{QS}|} = \frac{|det(\vec{QR} , \vec{QS} , \vec{QP})|}{|| \vec{QR}\wedge \vec{QS}|| })
</center>
}}