{ Taala-JSP CODE FOR JSX CONVERSION 29.11.2019 MEP } { Muista täpättää LaTeX points: } { Lineaarialgebra: PNS-yhtälöryhmän ratkaisu 3x2 } { 1. Kolmen yhtälön PNS-ratkaisuista } { JSX board name: PNS_YR3x2 } { JSX element id: pns_yr3x2 } #CODE = "GSP.class" #CODEBASE = "../jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 400 #HEIGHT = 430 #ALIGN = Center *Frame = 1 *TextFont = "Courier" *TextBold = 0 *TextSize = 14 *LabelFont = "Courier" *LabelBold = 0 *LabelSize = 14 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 0 *MeasureInDegrees = 1 *DirectedAngles = 0 *BackBlue = 230 *BackGreen = 255 *BackRed = 255 $xText FixedText(400,192,'x1')[bold, black, justifyCenter]; {,text('\\( x \\)')} $yText FixedText(240, 15,'x2')[bold, black, justifyCenter]; {,text('\\( y \\)')} { For scaling } $RO FixedPoint(200,400)[black,label('0')]; {,labelAlign(-4,-12)} $Ref Translation($RO,40,0)[hidden]; $Ray Ray($Ref,$RO)[black, hidden]; $Rykk Point on object($Ray,1)[white, label('1'), hidden]; $R1Vis FixedPoint(240,400)[white,label('1')]; {,labelAlign(-4,-12)} $RL Line($Rykk,$RO)[black]; {,arrowL} $Rpta Point on object($RL,1)[label('a'), red, layer(10), hidden]; {,labelAlign(-2,4),highlight} $Ra Ratio/Points($RO,$Rykk,$Rpta,320,35,'a = ')[red]; $Rptb Point on object($RL,2)[label('b'), color(0,150,0), layer(15), hidden]; {,labelAlign(-2,10),highlight} $Rb Ratio/Points($RO,$Rykk,$Rptb,320,55,'b = ')[color(0,150,0)]; $Rptc Point on object($RL,3)[label('c'), blue, layer(20), hidden]; {,labelAlign(-2,12),highlight} $Rc Ratio/Points($RO,$Rykk,$Rptc,320,75,'c = ')[blue]; $LUpp FixedPoint(0,380)[hidden]; $LLow FixedPoint(0,430)[hidden]; $RLow FixedPoint(400,430)[hidden]; $RUpp FixedPoint(400,380)[hidden]; $RectA Polygon($LUpp,$LLow,$RLow,$RUpp,$LUpp)[yellow]; $SBRL ShowButton( 5,352,'Scale equations')($RO,$R1Vis,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black]; $HBRL HideButton(100,352,'Fix')( $RO,$R1Vis,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black]; { The Plane Coordinate System } $O FixedPoint(200, 200) [black, label('0')]; $unitp UnitPoint($O, 40) [white, label('1'),hidden]; $ykk FixedPoint(240,200)[white, label('1')]; $coord Origin&Unit($O, $unitp)[black]; $Xax AxisX($coord)[black]; $Yax AxisY($coord)[black,hidden]; $YaxStart FixedPoint(200,380)[hidden]; $YaxVis Ray($O,$YaxStart)[black]; {,arrowL} $Sunit Segment($O,$unitp)[hidden]; { The lines defined by a point and direction } $P1 Point(70,220)[red, label('P1')]; {,label('PSUB{1}'),LabelAlign(5,5),psize(3),highlight} $CirP Circle by radius($P1,$Sunit)[red]; {,dash(1)} $P2 Point on object($CirP, 1)[red, label('P2')]; {,label('PSUB{2}'),LabelAlign(5,5),highlight} $LP1P2 Line($P1,$P2)[red,hidden]; $CoP1 Coordinates($P1,$coord,20,100,'P1 = ')[red,hidden]; $CoP2 Coordinates($P2,$coord,20, 60,'P2 = ')[red,hidden]; $a11pr Calculate( 0,35,'','#B2 #A2 -')($CoP1,$CoP2)[red,suffix('x'), hidden]; $a12pr Calculate( 57,35,'+(','#A1 #B1 -')($CoP1,$CoP2)[red,suffix(')y = '), hidden]; $b1pr Calculate(152,35,'','#B2 #A2- #A1* #B1 #A1- #A2* -')($CoP1,$CoP2)[red, hidden]; $a11 Calculate(0,35,'','AB*')($a11pr,$Ra)[red, suffix('x'), hidden]; $a12 Calculate(57,35,'+(','AB*')($a12pr,$Ra)[red, suffix(')y = '), hidden]; $b1 Calculate(152,35,'','AB*')($b1pr,$Ra)[red, hidden]; $Q1 Point(200,320)[color(0,150,0), label('Q1')]; {,label('QSUB{1}'),LabelAlign(5,5),psize(3),highlight} $CirQ Circle by radius($Q1,$Sunit)[color(0,150,0)]; {,dash(1)} $Q2 Point on object($CirQ, 3)[color(0,150,0), label('Q2')]; {,label('QSUB{2}'),LabelAlign(5,5),highlight} $LQ1Q2 Line($Q1,$Q2)[color(0,150,0),hidden]; $CoQ1 Coordinates($Q1,$coord,20,100,'Q1 = ')[color(0,150,0),hidden]; $CoQ2 Coordinates($Q2,$coord,20, 60,'Q2 = ')[color(0,150,0),hidden]; $a21pr Calculate( 0,55,'','#B2 #A2 -')($CoQ1,$CoQ2)[color(0,150,0),suffix('x'), hidden]; $a22pr Calculate( 57,55,'+(','#A1 #B1 -')($CoQ1,$CoQ2)[color(0,150,0),suffix(')y = '), hidden]; $b2pr Calculate(152,55,'','#B2 #A2- #A1* #B1 #A1- #A2* -')($CoQ1,$CoQ2)[color(0,150,0), hidden]; $a21 Calculate( 0,55,'','AB*')($a21pr,$Rb)[color(0,150,0), suffix('x'), hidden]; $a22 Calculate(57,55,'+(','AB*')($a22pr,$Rb)[color(0,150,0), suffix(')y = '), hidden]; $b2 Calculate(152,55,'','AB*')($b2pr,$Rb)[color(0,150,0), hidden]; $R1 Point(120,240)[blue, label('R1')]; {,label('RSUB{1}'),LabelAlign(5,5),psize(3),highlight} $CirR Circle by radius($R1,$Sunit)[blue]; {,dash(1)} $R2 Point on object($CirR, 5)[blue, label('R2')]; {,label('RSUB{2}'),LabelAlign(5,5),highlight} $LR1R2 Line($R1,$R2)[blue,hidden]; $CoR1 Coordinates($R1,$coord,20,100,'R1 = ')[blue,hidden]; $CoR2 Coordinates($R2,$coord,20, 60,'R2 = ')[blue,hidden]; $a31pr Calculate( 0,75,'','#B2 #A2 -')($CoR1,$CoR2)[blue,suffix('x'), hidden]; $a32pr Calculate( 57,75,'+(','#A1 #B1 -')($CoR1,$CoR2)[blue,suffix(')y = '), hidden]; $b3pr Calculate(152,75,'','#B2 #A2- #A1* #B1 #A1- #A2* -')($CoR1,$CoR2)[blue, hidden]; $a31 Calculate( 0,75,'','AB*')($a31pr,$Rc)[blue, suffix('x'), hidden]; $a32 Calculate(57,75,'+(','AB*')($a32pr,$Rc)[blue, suffix(')y = '), hidden]; $b3 Calculate(152,75,'','AB*')($b3pr,$Rc)[blue, hidden]; $A Calculate(205, 10,'A = ','A2^ B2^ + C2^ +')($a11,$a21,$a31)[black,hidden]; $B Calculate(205, 25,'B = ','AD* BE* + CF* +')($a11,$a21,$a31,$a12,$a22,$a32)[black,hidden]; $C Calculate(205, 40,'C = ','A2^ B2^ + C2^ +')($a12,$a22,$a32)[black,hidden]; $D Calculate(205, 55,'D = ','AD* BE* + CF* +')($a11,$a21,$a31,$b1,$b2,$b3)[black,hidden]; $E Calculate(205, 70,'E = ','AD* BE* + CF* +')($a12,$a22,$a32,$b1,$b2,$b3)[black,hidden]; $det Calculate(205, 85,'det = ','AC* BB* -')($A,$B,$C)[black,hidden]; $x1 Calculate(205,100,'x1 = ','AD* BC* - E /')($D,$B,$E,$C,$det)[black,hidden]; $x2 Calculate(205,115,'x2 = ','AD* BC* - E /')($A,$D,$B,$E,$det)[black,hidden]; $x PlotXY($x2,$coord,$x1)[magenta, label('x'), layer(10)]; {,label(' \\widehat {(x,y)}'),LabelAlign(5,10)} $xtr PlotXY($x2,$coord,$x1)[magenta, label('x'), layer(10), traced, hidden]; {,label(' \\widehat {(x,y)}'),LabelAlign(5,10)} $Cx Coordinates($x,$coord,60,132,'')[magenta, bold]; $CxText FixedText(100,125,'')[bold, black, justifyCenter]; {,text('\\( \\widehat {(x,y)} = \\)')} $SBCircles ShowButton( 280,120,'Show circles')($CirP, $CirQ, $CirR)[black]; $HBCircles HideButton(360,120,'Hide')($CirP, $CirQ, $CirR)[black]; $SBxtr ShowButton( 5,145,'Trace x')($xtr)[magenta]; {,text('Trace \\( \\widehat {(x,y)} \\)')} $HBxtr HideButton(85,150,'Stop')($xtr)[magenta]; $SBeq ShowButton(5,0,'Equations')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3)[black,bold]; $HBeq HideButton(70,0,'Hide')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3)[black,bold]; $YV FixedPoint(0,0)[hidden]; $YO FixedPoint(400,0)[hidden]; $AV FixedPoint(0,380)[hidden]; $AO FixedPoint(400,380)[hidden]; $LYVYO Segment($YV,$YO)[black,hidden]; $LAVAO Segment($AV,$AO)[black,hidden]; $LYVAV Segment($YV,$AV)[black,hidden]; $LYOAO Segment($YO,$AO)[black,hidden]; $IYLP1P2 Intersect($LYVYO,$LP1P2)[hidden]; $IALP1P2 Intersect($LAVAO,$LP1P2)[hidden]; $IVLP1P2 Intersect($LYVAV,$LP1P2)[hidden]; $IOLP1P2 Intersect($LYOAO,$LP1P2)[hidden]; $SP1 Segment($IYLP1P2,$IALP1P2)[red]; $SP2 Segment($IYLP1P2,$IVLP1P2)[red,hidden]; $SP3 Segment($IYLP1P2,$IOLP1P2)[red,hidden]; $SP4 Segment($IALP1P2,$IVLP1P2)[red,hidden]; $SP5 Segment($IOLP1P2,$IVLP1P2)[red,hidden]; $SP6 Segment($IALP1P2,$IOLP1P2)[red,hidden]; $IYLQ1Q2 Intersect($LYVYO,$LQ1Q2)[hidden]; $IALQ1Q2 Intersect($LAVAO,$LQ1Q2)[hidden]; $IVLQ1Q2 Intersect($LYVAV,$LQ1Q2)[hidden]; $IOLQ1Q2 Intersect($LYOAO,$LQ1Q2)[hidden]; $SQ1 Segment($IYLQ1Q2,$IALQ1Q2)[color(0,150,0)]; $SQ2 Segment($IYLQ1Q2,$IVLQ1Q2)[color(0,150,0),hidden]; $SQ3 Segment($IYLQ1Q2,$IOLQ1Q2)[color(0,150,0),hidden]; $SQ4 Segment($IALQ1Q2,$IVLQ1Q2)[color(0,150,0),hidden]; $SQ5 Segment($IOLQ1Q2,$IVLQ1Q2)[color(0,150,0),hidden]; $SQ6 Segment($IALQ1Q2,$IOLQ1Q2)[color(0,150,0),hidden]; $IYLR1R2 Intersect($LYVYO,$LR1R2)[hidden]; $IALR1R2 Intersect($LAVAO,$LR1R2)[hidden]; $IVLR1R2 Intersect($LYVAV,$LR1R2)[hidden]; $IOLR1R2 Intersect($LYOAO,$LR1R2)[hidden]; $SR1 Segment($IYLR1R2,$IALR1R2)[blue]; $SR2 Segment($IYLR1R2,$IVLR1R2)[blue,hidden]; $SR3 Segment($IYLR1R2,$IOLR1R2)[blue,hidden]; $SR4 Segment($IALR1R2,$IVLR1R2)[blue,hidden]; $SR5 Segment($IOLR1R2,$IVLR1R2)[blue,hidden]; $SR6 Segment($IALR1R2,$IOLR1R2)[blue,hidden];