!set title=Distancia entre dos rectas
!if $wims_read_parm!=$empty
 !goto $wims_read_parm
!endif
oef2wims_version=3.22
language=es
leftrange=-5.000000
rightrange=5.000000
author=Bernadette PERRIN-RIOU
email=bpr@math.u-psud.fr
computeanswer=yes
precision=10000

ansorder=c,r
varcnt=38
prevarcnt=37
postvarcnt=0
replycnt=1
choicecnt=1
conditioncnt=0
feedbackcnt=0
format=html

val1=$imagedir
val2=$confparm1
val3=$confparm2
val4=$confparm3
val5=$confparm4

!if $testcondition=yes
 !goto test
!endif
!if $status=waiting
 !exit
!endif

tmp0=!randint -10, 10

val6=$[rint($(tmp0))]
tmp0=!randint -10, 10

val7=$[rint($(tmp0))]
tmp0=!randint -10, 10

val8=$[rint($(tmp0))]
!if ($val6)^2+($val7)^2+($val8)^2=0 
tmp0=!randint 1, 4

val8=$[rint($(tmp0))]
!endif
tmp0=!randint -5, 5

val9=$[rint($(tmp0))]
tmp0=!randint -5, 5

val10=$[rint($(tmp0))]
tmp0=!randint -1, 1

val11=$[rint($(tmp0))]
tmp0=!randitem 1,0

val12=$(tmp0)
tmp0=!randitem 1,2,3,-1,-2

val13=$(tmp0)

!ifval $val12=1 
tmp0=!randint -5, 5

val14=$[rint(  $(tmp0))]
!else
val14=$[rint( ($val9)+($val13)*($val6))]
!endif

!ifval $val12=1 
tmp0=!randint -5, 5

val15=$[rint(  $(tmp0))]
!else
val15=$[rint( ($val10)+($val13)*($val7))]
!endif

!ifval $val12=1 
tmp0=!randint -5, 5

val16=$[rint(  $(tmp0))]
!else
val16=$[rint( ($val11)+($val13)*($val8))]
!endif
tmp0=!randitem 1,2

val17=$(tmp0)
tmp0=!randint 1, 5

tmp1=!randitem 1,-1

val18=$[rint($(tmp0)*$(tmp1))]

!ifval $val17=1 
tmp0=!randint -10, 10

val19=$[rint( $(tmp0))]
!else
val19=$[rint( ($val18)*($val6))]
!endif

!ifval $val17=1 
tmp0=!randint -10, 10

val20=$[rint( $(tmp0))]
!else
val20=$[rint( ($val18)*($val7))]
!endif

!ifval $val17=1 
tmp0=!randint -10, 10

val21=$[rint( $(tmp0))]
!else
val21=$[rint( ($val18)*($val8))]
!endif

!ifval ($val19)^2+($val20)^2+($val21)^2=0 
tmp0=!randint 1, 4

val19=$[rint( $(tmp0))]
!endif
tmp=!translate ";': to $     $ in $val9 +  ($val6)*t

tmp=!lower $tmp
tmp0=!exec maxima fullratsimp($tmp);
tmp=!translate ";': to $     $ in $val10 +  ($val7)*t

tmp=!lower $tmp
tmp1=!exec maxima fullratsimp($tmp);
tmp=!translate ";': to $     $ in $val11 + ($val8)*t

tmp=!lower $tmp
tmp2=!exec maxima fullratsimp($tmp);
val22=x =  $(tmp0), y = $(tmp1), z = $(tmp2)
tmp=!translate ";': to $     $ in $val14 +  ($val19)*t

tmp=!lower $tmp
tmp0=!exec maxima fullratsimp($tmp);
tmp=!translate ";': to $     $ in $val15 +  ($val20)*t

tmp=!lower $tmp
tmp1=!exec maxima fullratsimp($tmp);
tmp=!translate ";': to $     $ in $val16 + ($val21)*t

tmp=!lower $tmp
tmp2=!exec maxima fullratsimp($tmp);
val23=x =  $(tmp0) ,  y = $(tmp1), z = $(tmp2)
val24=$[(($val19)*($val7)-($val20)*($val6))^2+(($val21)*($val7)-($val20)*($val8))^2+(($val19)*($val8)-($val21)*($val6))^2]
tmp=!trim $val9-($val14),$val10-($val15), $val11-($val16)	$val6,$val7,$val8	$val19,$val20,$val21	
val25=!translate internal $	\
$ to ;; in $tmp
tmp=!translate $	$ to ; in $val25

tmp0=!exec pari matdet([$tmp])
val26=$[$(tmp0)]
val27=paralelas o coincidentes, secantes, non coplanarias

!ifval $val24=0 
val28= 1
!else
val28=3
!endif

!ifval $val26=0 and $val24 <>0 
val28= 2
!endif
tmp0=!item $val28 of $val27

val29=$(tmp0)
!if $val28=2 
val30=$[(($val6)*($val19)+($val7)*($val20)+($val8)*($val21))/	((($val6)^2+($val7)^2+($val8)^2)*(($val19)^2+($val20)^2+($val21)^2))^(1/2)]
!else
val31=$val6 , $val7 , $val8
val32=$val14 - ($val9) , $val15 - ($val10) , $val16 - ($val11)

!ifval $val28=3 
val33=  $val19 , $val20 , $val21
!endif

!ifval $val28 = 1 
val33= $val32
!endif
tmp0=!item 2 of $val31

tmp1=!item 3 of $val33

tmp2=!item 3 of $val31

tmp3=!item 2 of $val33

tmp4=!item 3 of $val31

tmp5=!item 1 of $val33

tmp6=!item 1 of $val31

tmp7=!item 3 of $val33

tmp8=!item 1 of $val31

tmp9=!item 2 of $val33

tmp10=!item 2 of $val31

tmp11=!item 1 of $val33

val34=$[(($(tmp0))*($(tmp1))-($(tmp2))*($(tmp3)))^2	+(($(tmp4))*($(tmp5))-($(tmp6))*($(tmp7)))^2	+(($(tmp8))*($(tmp9))-($(tmp10))*($(tmp11)))^2]

!ifval $val28=1 
tmp0=!item 1 of $val31

tmp1=!item 2 of $val31

tmp2=!item 3 of $val31

val30=$[ (($val34)/(($(tmp0))^2+($(tmp1))^2+($(tmp2))^2))^(1/2)]
!endif
!if $val28=3 
tmp=!trim $val31	  $val33	  $val32	  
val25=!translate internal $	\
$ to ;; in $tmp
tmp=!translate $	$ to ; in $val25

tmp0=!exec pari matdet([$tmp])
val30=$[abs($(tmp0))/($val34)^(1/2)]
!endif
!endif

!ifval para=2 
val35= cosinus
!else
val35=distance
!endif
oefsteps=choice 1	reply 1 
nextstep=!nosubst choice 1	reply 1 
!readproc oef/steps.proc
replytype1=numeric
replyname1=$val35
replygood1=$[$val30]
choicename1=Las rectas son
choicegood1=$val29
choicebad1=$val27
question=__EXECUTED_1692754_EXERCISE__
hint=__EXECUTED_1692754_EXERCISE__

!goto stat

!exit

:question
$()Consideremos las dos rectas en el espacio, dadas por sus ecuaciones paramétricas : 	<center>  
!insmath $val22
$() </center>	y 	<center>
!insmath $val23 
$()</center>	  
!if $m_step <=1 
$()Estas reectas son  
!read oef/embed.phtml choice 1 
$()	 
!endif
$()	 
!if $m_step=2 
$() 	 
!if  $val28= 1 
$() Calcular la distancia entre estas dos rectas paralelas. 
!endif
$()	 
!if  $val28= 2 
$()Calcular los cosenos de los ángulos que forman entre ellas estas dos rectas secantes. 
!endif
$()	 
!if  $val28= 3 
$()Calcular la distancia entre estas dos rectas no coplanarias. 
!endif
$()	 
!endif
$()	
$()
!exit

:hint
$()	   
!if $m_step <=1 
$()Dos rectas del espacio o son paralelas, o son secantes o bien ni lo uno ni lo otro y entonces se dice que son no coplanarias o que se cruzan. 
!endif
$()	   
!if $m_step =2 and $val28=2 
$()Para calcular el ángulo que forman dos rectas secantes en el espacio,  basta calcular el ángulo que forman sus vectores dirección.  
!endif
$()	   
!if $m_step =2 and $val28=3 
$()	Para calcular la distancia entre dos rectas que se cruzan, se considera un plano paralelo a mabas rectas que contenga a una de ellas. Se calcula a continuación la distancia desde un punto cualquiera de la otra recta al plano hallado.   
!endif
$()	   
!if $m_step =2 and $val28=3 
$()	  Para calcular la distancia entre dos rectas paralelas, se calcula la distancia de un punto cualquiera de una a la otra recta.	   
!endif
$()	
$()
!exit

:help
$()
$()
!exit

:solution
$()
$()
!exit

:feedback

!exit

:test

!exit

:stat
vsavelist=22,23,28
embedcnt=1
