Fetch the repository succeeded.
%An interactive document that uses JavaScript to
%perform simple vector operations.
%
%Faro, Portugal, 05/04/2003 at 22:00h
%Written by Orlando Camargo Rodrguez
%
%In order to compile this document the insdljs.sty and
%dljscc.def files are required. Those files should be
%available at http://www.math.uakron.edu/~dpstory/webeq.html
%
\newcommand{\va}{\mbox{$\mathbf{a}$}}
\newcommand{\vb}{\mbox{$\mathbf{b}$}}
\newcommand{\ve}{\mbox{$\mathbf{e}$}}
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage{graphicx}
\usepackage[pdfpagemode=FullView]{hyperref}
\usepackage[pdftex]{insdljs}
\begin{insDLJS}[vecsum]{vecsum}{My Private vector sum}
function vecsum()
{
var output1 = this.getField("Output.First");
var output2 = this.getField("Output.Second");
var output3 = this.getField("Output.Third");
output1.value = v1x.value + v2x.value ;
output2.value = v1y.value + v2y.value ;
output3.value = v1z.value + v2z.value ;
}
\end{insDLJS}
\begin{insDLJS}[innerpro]{innerpro}{My Private vector inner product}
function innerpro()
{
var absv1 = 0 ;
var absv2 = 0 ;
var costheta = 0 ;
var output4 = this.getField("Output.Fourth");
var output5 = this.getField("Output.Fifth");
output4.value = v1x.value*v2x.value + v1y.value*v2y.value + v1z.value*v2z.value ;
absv1 = Math.sqrt( v1x.value*v1x.value + v1y.value*v1y.value + v1z.value*v1z.value );
absv2 = Math.sqrt( v2x.value*v2x.value + v2y.value*v2y.value + v2z.value*v2z.value );
costheta = output4.value/( absv1*absv2 ) ;
output5.value = Math.acos( costheta )*180/Math.PI ;
}
\end{insDLJS}
\begin{insDLJS}[outerpro]{outerpro}{My Private vector outer product}
function outerpro()
{
var output6 = this.getField("Output.Sixth");
var output7 = this.getField("Output.Seventh");
var output8 = this.getField("Output.Eighth");
output6.value = v1y.value*v2z.value - v1z.value*v2y.value;
output7.value = v1z.value*v2x.value - v1x.value*v2z.value;
output8.value = v1x.value*v2y.value - v1y.value*v2x.value;
}
\end{insDLJS}
%Let's go:
\begin{document}
\begin{Form}
\hrule
\vskip3mm
\hrule
\vskip5mm
\centerline{\em Insira as componentes dos vectores:}
\vskip15mm
\centerline{
\begin{tabular}{ccccc}
\hskip2mm$\va$\hskip2mm & = &
\TextField[width=30mm,name=Inputv1.First,borderstyle=I,value={},align=1,
validate={v1x=this.getField("Inputv1.First");}]{ }{\ $\ve_x+$} &
\TextField[width=30mm,name=Inputv1.Second,borderstyle=I,value={},align=1,
validate={v1y=this.getField("Inputv1.Second");}]{ }{\ $\ve_y+$} &
\TextField[width=30mm,name=Inputv1.Third,borderstyle=I,value={},align=1,
validate={v1z=this.getField("Inputv1.Third");}]{ }{\ $\ve_z$} \\
\ \\
\hskip2mm$\vb$\hskip2mm & = &
\TextField[width=30mm,name=Inputv2.First,borderstyle=I,value={},align=1,
validate={v2x=this.getField("Inputv2.First");}]{ }{\ $\ve_x+$} &
\TextField[width=30mm,name=Inputv2.Second,borderstyle=I,value={},align=1,
validate={v2y=this.getField("Inputv2.Second");}]{ }{\ $\ve_y+$} &
\TextField[width=30mm,name=Inputv2.Third,borderstyle=I,value={},align=1,
validate={v2z=this.getField("Inputv2.Third");}]{ }{\ $\ve_z$} \\
\ \\
\ \\
\ \\
\multicolumn{5}{c}{\em Clique em cada bot\~ao para executar o c\'alculo respectivo:} \\
\ \\
\PushButton[name=pb1,borderstyle=B,borderwidth=1.5,onclick={vecsum();}]
{\hskip2mm$\va+\vb$\hskip2mm}
& = &
\TextField[width=30mm,name=Output.First,borderstyle=I,value={},align=1,
validate={output1=this.getField("Output.First");}]{ }{\ $\ve_x+$} &
\TextField[width=30mm,name=Output.Second,borderstyle=I,value={},align=1,
validate={output2=this.getField("Output.Second");}]{ }{\ $\ve_y+$} &
\TextField[width=30mm,name=Output.Third,borderstyle=I,value={},align=1,
validate={output3=this.getField("Output.Third");}]{ }{\ $\ve_z$}
\end{tabular}
}
\vskip15mm
\centerline{
\PushButton[name=pb2,borderstyle=B,borderwidth=1.5,onclick={innerpro();}]
{\hskip2mm$\va\cdot\vb$\hskip2mm} =
\TextField[width=40mm,name=Output.Fourth,borderstyle=I,value={0},
align=1,validate={output4=this.getField("Output.Fourth");},
calculate={output4.value}]{ }
}
\vskip15mm
\centerline{
\PushButton[name=pb3,borderstyle=B,borderwidth=1.5,onclick={}]
{\hskip2mm$\theta$\hskip2mm} =
\TextField[width=40mm,name=Output.Fifth,borderstyle=I,value={0},
align=1,validate={output5=this.getField("Output.Fifth");}]{ }\hskip2mm$^\circ$
}
\vskip15mm
\centerline{
\PushButton[name=pb4,borderstyle=B,borderwidth=1.5,onclick={outerpro();}]
{\hskip2mm$\va\times\vb$\hskip2mm} =
\TextField[width=30mm,name=Output.Sixth,borderstyle=I,value={0},
align=1,validate={output6=this.getField("Output.Fifth");},
calculate={output1.value}]{ }{\ $\ve_x+$}
\TextField[width=30mm,name=Output.Seventh,borderstyle=I,value={0},
align=1,validate={output7=this.getField("Output.Sixth");},
calculate={output1.value}]{ }{\ $\ve_y+$}
\TextField[width=30mm,name=Output.Eighth,borderstyle=I,value={0},
align=1,validate={output8=this.getField("Output.Eighth");},
calculate={output1.value}]{ }{\ $\ve_z$}
}
\vskip5mm
\hrule
\vskip3mm
\hrule
\end{Form}
\end{document}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。