/////////// Initialization/KETlib /////////// use("KetCindyPlugin"); Dircdy=loaddirectory; setdirectory(gethome()); import("ketcindy.ini"); exflag=0; inflag=0; /////////// Draw/figures /////////// Ketinit(); Setketcindyjs(["Local=y","Nolabel=all","Color=offwhite","Equal="]); Ketcindyjsmain(["_;_;ベクトルの外積と内積"],[ "(1)_;$\vec{\ a}$の大きさを定める", "(2)_;$\vec{\ b}$の大きさとなす角$\theta$を定める.", "(3)_;外積ボタンまたは内積ボタンをクリックして,外積または内積の値を確認する."]); Addax(0); Putpoint("O",[0,0]); Letter([5,5.5],"e","$\vec{\ a}$の大きさ",["Size=1.5"]); Expr([7-0.1,5],"w","|\vec{\ a}|=",["Size=1.5"]); str1="1"; //str1=Textedit(51); only ketjs Seteditable(51,["=","Size=18","Width=10"]); Movetojs(51,[7,5-0.2],15); Putpoint("A",[parse(str1),0]); Expr(A,"e1","\vec{\ a}",["Size=1.5"]); Arrowdata("1",[O,A],[2,18,1,0.2]); Letter([5,3.5],"e","$\vec{\ b}$の大きさ",["Size=1.5"]); Expr([7-0.1,3],"w","|\vec{\ b}|=",["Size=1.5"]); str2="1"; //str2=Textedit(52); only ketjs Seteditable(52,["=","Size=18","Width=10"]); Movetojs(52,[7,3-0.2],15); Letter([5,1.5],"e","$\vec{\ a}$,$\vec{\ b}$のなす角",["Size=1.5"]); Expr([7-0.1,1],"w","\theta=",["Size=1.5"]); Expr([11.5,1],"e","\pi",["Size=1.5"]); str3="1/2"; //str3=Textedit(53); only ketjs Seteditable(53,["=","Size=18","Width=10"]); Movetojs(53,[7,1-0.2],15); Putpoint("B",parse(str2)*[cos(parse(str3)*pi),sin(parse(str3)*pi)]); Expr(B,"n1","\vec{\ b}",["Size=1.5"]); Arrowdata("2",[O,B],[2,18,1,0.2]); Anglemark("1",[A,O,B],[1,"Expr=1.2,\theta"]); Letter([5,-1.5],"e","$\vec{\ a}$と$\vec{\ b}$の外積",["Size=1.5"]); Expr([10-0.1,-2],"w","\vec{\ a}\times\vec{\ b}=|\vec{\ a}|\,|\vec{\ b}|\,\sin\theta=",["Size=1.5","Color=red"]); if(exflag==1, Listplot("da1",[A,A+B,B],["da","Color=red"]); Listplot("1",[O,A,A+B,B,O],["nodisp"]); Shade(["sg1"],["Color=red"]); Expr([10,-2],"e",text(parse(str1)*parse(str2)*sin(parse(str3)*pi)),["Size=1.5","Color=blue"]); ); Letter([5,-3],"e","$\vec{\ a}$と$\vec{\ b}$の内積",["Size=1.5"]); Expr([10-0.1,-3.5],"w","\vec{\ a}\cdot\vec{\ b}=|\vec{\ a}|\,|\vec{\ b}|\,\cos\theta=",["Size=1.5","Color=blue"]); if(inflag==1, if(parse(str3)!=1/2, Putpoint("H",parse(str2)*[cos(parse(str3)*pi),0]); Expr(H,"s1","\vec{\ h}",["Size=1.5","Color=blue"]); Arrowdata("3",[O,H],[2,18,1,0.2,"Color=blue"]); Listplot("da2",[B,H],["da","Color=blue"]); ); Expr([10,-3.5],"e",text(parse(str1)*parse(str2)*cos(parse(str3)*pi)),["Size=1.5","Color=blue"]); ); Windispg();