Geometry & Linear Algebra

Lines in the plane and Least Squares Method - A Uniqueness Problem

Part I. Lines in the plane and Least Squares Solution - Glimpse on theory

A very compact form to express a system of linear equations
ì
ï
ï
í
ï
ï
î
a11x1
+
a12x2
+
¼
+
a1nxn
=
b1
a21x1
+
a22x2
+
¼
+
a2nxn
=
b2
:
am1x1
+
am2x2
+
¼
+
amnxn
=
bm
is to use matrix language adopted from Linear Algebra. We introduce the coefficient matrix A = (aij)m×n, the column vector b for the right side known numbers and the column x for the unknowns. Then the system looks like
æ
ç
ç
ç
ç
ç
è
a11
a12
¼
a1n
a21
a22
¼
a2n
:
:
···
:
am1
am2
¼
amn
ö
÷
÷
÷
÷
÷
ø
æ
ç
ç
ç
ç
ç
è
x1
x2
:
xn
ö
÷
÷
÷
÷
÷
ø
= æ
ç
ç
ç
ç
ç
è
b1
b2
:
bm
ö
÷
÷
÷
÷
÷
ø
and briefly
Ax = b.
If we have more equations than unknowns, we usually do not get any answer to the problem at all.



The same way, a general matrix equation Ax = b may not have solutions, but also, often there are infinitely many solutions.

But if the matrix A Î Rm×n is of ''full rank'', which means that all the columns of A are linearly independent (libre), then the normal equation
ATAx = AT b
has a unique solution
x0 : = (ATA)-1 AT b,
which is called the Least Squares Solution to the matrix equation Ax = b.

This solution of the normal equation is the unique vector x0, for which the residual Ax - b has minimum norm ||Ax0 - b||.

Immediate application

Solve
ì
ï
í
ï
î
x1
+
x2
=
3
-2x1
+
3x2
=
1
2x1
-
x2
=
2
Solution. There is no solution. However there might be some convenient answer. Let A be the coefficient matrix. Then the normal equation has the form
ATA x
=
AT b
Û
æ
ç
è
1
-2
2
1
3
-1
ö
÷
ø
æ
ç
ç
ç
è
1
1
-2
3
2
-1
ö
÷
÷
÷
ø
æ
ç
è
x1
x2
ö
÷
ø
=
æ
ç
è
1
-2
2
1
3
-1
ö
÷
ø
æ
ç
ç
ç
è
3
1
2
ö
÷
÷
÷
ø
Û
æ
ç
è
9
-7
-7
11
ö
÷
ø
æ
ç
è
x1
x2
ö
÷
ø
=
æ
ç
è
5
4
ö
÷
ø
Û
æ
ç
è
x1
x2
ö
÷
ø
=
æ
ç
ç
ç
ç
ç
è
 83

50
 71

50
ö
÷
÷
÷
÷
÷
ø
The Least Squares solution to Ax = b is
æ
ç
è
x1
x2
ö
÷
ø
= æ
ç
ç
ç
ç
ç
è
 83

50
 71

50
ö
÷
÷
÷
÷
÷
ø
= æ
ç
è
1,66
1,42
ö
÷
ø
Unfortunately, it turns out that if we use a different representation of the lines, we get different solutions! For example, if we take
ì
ï
í
ï
î
10x1
+
10x2
=
30
-2x1
+
3x2
=
1
2x1
-
x2
=
2
we have exactly the same plane lines, but the Least Squares solution would be
æ
ç
è
x1
x2
ö
÷
ø
= æ
ç
ç
ç
ç
ç
è
 691

427
 1181

854
ö
÷
÷
÷
÷
÷
ø
= æ
ç
è
1,62
1,38
ö
÷
ø
The dynamical pictures (''sketches'') below allow us to experiment the problem in a visual way.

Part II. Lines in the plane and Least Squares Solution - Experiments

Now we shall do some experiments on overdetermined systems of two-unknown linear equations and the Least Squares Method on finding a "compromise" solution.
We see very concretely that uniqueness problems raise when we try to combine linear algebra tools and geometry.

The geometrical representations of the linear equations

ai1x1 + ai2x2 = bi
as lines in the plane. Remember that this could be written in Linear Algebra language as matrix equation
Ax = b
where x is the vector of the unknowns xi.

1. Solutions for systems of three equations

${ 1. Kolmen suoran leikkauspisteen sovitus $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 406 #HEIGHT = 420 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 230 *BackGreen = 255 *Backred = 255 $reset FixedText(385,15,'Reset = ''R''')[black,bold,justifyRight]; $Clear FixedText(370,412,'Clear trace x ->')[red,plain,font('Courier'),bold,justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; ${ for scaling $} $RO FixedPoint(200,400)[black,label('0'),hidden]; $Ref Translation($RO,40,0)[hidden]; $Ray Ray($Ref,$RO)[black, hidden]; $Rykk Point on object($Ray,1)[white, label('1'), hidden]; $R1 FixedPoint(240,400)[white,label('1'),hidden]; $RL Line($Rykk,$RO)[black,hidden]; $Rpta Point on object($RL,1)[label('a'), red, layer(10), hidden]; $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]; $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]; $Rc Ratio/Points($RO,$Rykk,$Rptc,320,75,'c = ')[blue]; $LUpp FixedPoint(0,386)[hidden]; $LLow FixedPoint(0,420)[hidden]; $RLow FixedPoint(406,420)[hidden]; $RUpp FixedPoint(406,386)[hidden]; $ULine Line($LUpp,$RUpp)[black]; $RectA Polygon($LUpp,$LLow,$RLow,$RUpp,$LUpp)[yellow,hidden]; $SBRL ShowButton( 0,365,'Scale eqs')($RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black]; $HBRL HideButton(62,365,'Fix')( $RO,$R1,$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]; $Sunit Segment($O,$unitp)[hidden]; $P1 Point(200,80)[red, label('P1')]; $Cir Circle by radius($P1,$Sunit)[red, hidden]; $P2 Point on object($Cir, 1)[red, label('P2')]; $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')]; $Cir Circle by radius($Q1,$Sunit)[color(0,150,0), hidden]; $Q2 Point on object($Cir, 3)[color(0,150,0), label('Q2')]; $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')]; $Cir Circle by radius($R1,$Sunit)[blue, hidden]; $R2 Point on object($Cir, 5)[blue, label('R2')]; $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('x0'), layer(10)]; $xtr PlotXY($x2,$coord,$x1)[magenta, label('x0'), layer(10), traced, hidden]; $Cx Coordinates($x,$coord,5,155,'x0 = ')[magenta, bold]; $SBxtr ShowButton( 0,120,'Trace x0')($xtr)[magenta]; $HBxtr HideButton(55,120,'Stop')($xtr)[magenta]; $SBeq ShowButton(0,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(406,0)[hidden]; $AV FixedPoint(0,386)[hidden]; $AO FixedPoint(406,386)[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]; Segment($IYLP1P2,$IALP1P2)[red]; Segment($IYLP1P2,$IVLP1P2)[red]; Segment($IYLP1P2,$IOLP1P2)[red]; Segment($IALP1P2,$IVLP1P2)[red]; Segment($IOLP1P2,$IVLP1P2)[red]; Segment($IALP1P2,$IOLP1P2)[red]; $IYLQ1Q2 Intersect($LYVYO,$LQ1Q2)[hidden]; $IALQ1Q2 Intersect($LAVAO,$LQ1Q2)[hidden]; $IVLQ1Q2 Intersect($LYVAV,$LQ1Q2)[hidden]; $IOLQ1Q2 Intersect($LYOAO,$LQ1Q2)[hidden]; Segment($IYLQ1Q2,$IALQ1Q2)[color(0,150,0)]; Segment($IYLQ1Q2,$IVLQ1Q2)[color(0,150,0)]; Segment($IYLQ1Q2,$IOLQ1Q2)[color(0,150,0)]; Segment($IALQ1Q2,$IVLQ1Q2)[color(0,150,0)]; Segment($IOLQ1Q2,$IVLQ1Q2)[color(0,150,0)]; Segment($IALQ1Q2,$IOLQ1Q2)[color(0,150,0)]; $IYLR1R2 Intersect($LYVYO,$LR1R2)[hidden]; $IALR1R2 Intersect($LAVAO,$LR1R2)[hidden]; $IVLR1R2 Intersect($LYVAV,$LR1R2)[hidden]; $IOLR1R2 Intersect($LYOAO,$LR1R2)[hidden]; Segment($IYLR1R2,$IALR1R2)[blue]; Segment($IYLR1R2,$IVLR1R2)[blue]; Segment($IYLR1R2,$IOLR1R2)[blue]; Segment($IALR1R2,$IVLR1R2)[blue]; Segment($IOLR1R2,$IVLR1R2)[blue]; Segment($IALR1R2,$IOLR1R2)[blue]; In this Sketch you can make parallel moves for the lines by dragging with the computer mouse the points P1, Q1 and R1. You can turn the lines around with the points P2, Q2 and R2.
Also you can multiply the equations by numbers a, b tai c. Try all the buttons in the Sketch.

The point x is the least squares solution of the equations on the screen. Move the line P1P2 by moving the points P1 and P2.
Move the other lines too. Reset when you want.

Problems

1. Explain why x0 is moving, though the lines do not move when you change a, b or c (push Scale eqs first).

2. How is x0 moving when you vary a from -infinity to +infinity?
Answer the same question for b and c.

3. What is the curve described by x0 when P2 is describing a circle and all other given points are fixed?


Puzzle 1

${ Puzzle 1 $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 400 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 230 *BackGreen = 255 *Backred = 255 $MP Point(100,100)[red,label('x')]; ${ $reset FixedText(385,15,'Reset = ''R''')[black,bold,justifyRight]; $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ for scaling $} $RO FixedPoint(200,400)[black,label('0'),hidden]; $Ref Translation($RO,40,0)[hidden]; $Ray Ray($Ref,$RO)[black, hidden]; $Rykk Point on object($Ray,1)[white, label('1'), hidden]; $R1 FixedPoint(240,400)[white,label('1'),hidden]; $RL Line($Rykk,$RO)[black,hidden]; $Rpta Point on object($RL,1)[label('a'), red, layer(10), hidden]; $Ra Ratio/Points($RO,$Rykk,$Rpta,320,35,'a = ')[red, hidden]; $Rptb Point on object($RL,1)[label('b'), color(0,150,0), layer(15), hidden]; $Rb Ratio/Points($RO,$Rykk,$Rptb,320,55,'b = ')[color(0,150,0), hidden]; $Rptc Point on object($RL,1)[label('c'), blue, layer(20), hidden]; $Rc Ratio/Points($RO,$Rykk,$Rptc,320,75,'c = ')[blue, hidden]; $LUpp FixedPoint(0,386)[hidden]; $LLow FixedPoint(0,420)[hidden]; $RLow FixedPoint(406,420)[hidden]; $RUpp FixedPoint(406,386)[hidden]; $ULine Line($LUpp,$RUpp)[black, hidden]; $RectA Polygon($LUpp,$LLow,$RLow,$RUpp,$LUpp)[yellow,hidden]; $SBRL ShowButton( 0,365,'Scale eqs')($RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; $HBRL HideButton(62,365,'Fix')( $RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; ${ The Plane Coordinate System $} $O FixedPoint(200, 200) [black, label('0'),hidden]; $unitp UnitPoint($O, 40) [white, label('1'),hidden]; $ykk FixedPoint(240,200)[white, label('1'),hidden]; $coord Origin&Unit($O, $unitp)[black,hidden]; $Xax AxisX($coord)[black,hidden]; $Yax AxisY($coord)[black,hidden]; $Sunit Segment($O,$unitp)[hidden]; $P1 Point(280,150)[red, label('P1'), hidden]; $Cir Circle by radius($P1,$Sunit)[red, hidden]; $P2 Point on object($Cir, 1)[red, label('P2'),hidden]; $LP1P2 Line($P1,$P2)[red]; $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'), hidden]; $Cir Circle by radius($Q1,$Sunit)[color(0,150,0), hidden]; $Q2 Point on object($Cir, 3)[color(0,150,0), label('Q2'),hidden]; $LQ1Q2 Line($Q1,$Q2)[color(0,150,0)]; $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'), hidden]; $Cir Circle by radius($R1,$Sunit)[blue, hidden]; $R2 Point on object($Cir, 5)[blue, label('R2'),hidden]; $LR1R2 Line($R1,$R2)[blue]; $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), hidden]; $xtr PlotXY($x2,$coord,$x1)[magenta, label('x'), layer(10), traced, hidden]; $Cx Coordinates($x,$coord,5,195,'x = ')[magenta, bold,hidden]; $dist Distance( $MP, $x, 0, 50, 'et = ') [blue,hidden]; $flag Calculate( 0, 70, 'luku = ','2 3 A- @sqrt 0.000001 * +')($dist)[red,hidden]; $vastx Translation/FixedAngle/MarkedDistance($x, $flag,0)[red,label('x0 ICI!'),layer(20)]; $Cvastx Coordinates($vastx,$coord,5,195,'x0 = ')[magenta, bold]; ${ $SBxtr ShowButton( 0,160,'Trace x0')($xtr)[magenta,hidden]; $HBxtr HideButton(57,160,'Stop')($xtr)[magenta,hidden]; $SBeq ShowButton(0,0,'Equations')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3)[black,bold,hidden]; $HBeq HideButton(70,0,'Hide')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3)[black,bold,hidden]; $}

Puzzle 1 Problem

Try to find the least squares solution x0 of the system of the equations for the lines in the Sketch.

Give the coordinates of x0:



Puzzle 2

${ Puzzle 2 $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 400 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 230 *BackGreen = 255 *Backred = 255 $MP Point(100,100)[red,label('x')]; ${ $reset FixedText(385,15,'Reset = ''R''')[black,bold,justifyRight]; $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ for scaling $} $RO FixedPoint(200,400)[black,label('0'),hidden]; $Ref Translation($RO,40,0)[hidden]; $Ray Ray($Ref,$RO)[black, hidden]; $Rykk Point on object($Ray,1)[white, label('1'), hidden]; $R1 FixedPoint(240,400)[white,label('1'),hidden]; $RL Line($Rykk,$RO)[black,hidden]; $Rpta Point on object($RL,1)[label('a'), red, layer(10), hidden]; $Ra Ratio/Points($RO,$Rykk,$Rpta,320,35,'a = ')[red, hidden]; $Rptb Point on object($RL,1)[label('b'), color(0,150,0), layer(15), hidden]; $Rb Ratio/Points($RO,$Rykk,$Rptb,320,55,'b = ')[color(0,150,0), hidden]; $Rptc Point on object($RL,1)[label('c'), blue, layer(20), hidden]; $Rc Ratio/Points($RO,$Rykk,$Rptc,320,75,'c = ')[blue, hidden]; $LUpp FixedPoint(0,386)[hidden]; $LLow FixedPoint(0,420)[hidden]; $RLow FixedPoint(406,420)[hidden]; $RUpp FixedPoint(406,386)[hidden]; $ULine Line($LUpp,$RUpp)[black, hidden]; $RectA Polygon($LUpp,$LLow,$RLow,$RUpp,$LUpp)[yellow,hidden]; $SBRL ShowButton( 0,365,'Scale eqs')($RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; $HBRL HideButton(62,365,'Fix')( $RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; ${ The Plane Coordinate System $} $O FixedPoint(200, 200) [black, label('0'),hidden]; $unitp UnitPoint($O, 40) [white, label('1'),hidden]; $ykk FixedPoint(240,200)[white, label('1'),hidden]; $coord Origin&Unit($O, $unitp)[black,hidden]; $Xax AxisX($coord)[black,hidden]; $Yax AxisY($coord)[black,hidden]; $Sunit Segment($O,$unitp)[hidden]; $P1 Point(180,200)[red, label('P1'), hidden]; $Cir Circle by radius($P1,$Sunit)[red, hidden]; $P2 Point on object($Cir, 1.7)[red, label('P2'),hidden]; $LP1P2 Line($P1,$P2)[red]; $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(220,200)[color(0,150,0), label('Q1'), hidden]; $Cir Circle by radius($Q1,$Sunit)[color(0,150,0), hidden]; $Q2 Point on object($Cir, -1.7)[color(0,150,0), label('Q2'),hidden]; $LQ1Q2 Line($Q1,$Q2)[color(0,150,0)]; $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(200,370)[blue, label('R1'), hidden]; $Cir Circle by radius($R1,$Sunit)[blue, hidden]; $R2 Point on object($Cir, 0.1)[blue, label('R2'),hidden]; $LR1R2 Line($R1,$R2)[blue]; $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), hidden]; $xtr PlotXY($x2,$coord,$x1)[magenta, label('x'), layer(10), traced, hidden]; $Cx Coordinates($x,$coord,5,195,'x = ')[magenta, bold,hidden]; $dist Distance( $MP, $x, 0, 50, 'et = ') [blue,hidden]; $flag Calculate( 0, 70, 'luku = ','2 3 A- @sqrt 0.000001 * +')($dist)[red,hidden]; $vastx Translation/FixedAngle/MarkedDistance($x, $flag,0)[red,label('x0 ICI!'),layer(20)]; $Cvastx Coordinates($vastx,$coord,5,195,'x0 = ')[magenta, bold]; ${ $SBxtr ShowButton( 0,160,'Trace x0')($xtr)[magenta,hidden]; $HBxtr HideButton(57,160,'Stop')($xtr)[magenta,hidden]; $SBeq ShowButton(0,0,'Equations')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3)[black,bold,hidden]; $HBeq HideButton(70,0,'Hide')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3)[black,bold,hidden]; $}

Puzzle 2 Problem

Try to find the least squares solution x0 of the system of the equations for the lines in the Sketch.

Give the coordinates of x0:



Puzzle 3

${ Puzzle 3 $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 400 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 230 *BackGreen = 255 *Backred = 255 $MP Point(100,100)[red,label('x')]; ${ $reset FixedText(385,15,'Reset = ''R''')[black,bold,justifyRight]; $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ for scaling $} $RO FixedPoint(200,400)[black,label('0'),hidden]; $Ref Translation($RO,40,0)[hidden]; $Ray Ray($Ref,$RO)[black, hidden]; $Rykk Point on object($Ray,1)[white, label('1'), hidden]; $R1 FixedPoint(240,400)[white,label('1'),hidden]; $RL Line($Rykk,$RO)[black,hidden]; $Rpta Point on object($RL,1)[label('a'), red, layer(10), hidden]; $Ra Ratio/Points($RO,$Rykk,$Rpta,320,35,'a = ')[red, hidden]; $Rptb Point on object($RL,1)[label('b'), color(0,150,0), layer(15), hidden]; $Rb Ratio/Points($RO,$Rykk,$Rptb,320,55,'b = ')[color(0,150,0), hidden]; $Rptc Point on object($RL,1)[label('c'), blue, layer(20), hidden]; $Rc Ratio/Points($RO,$Rykk,$Rptc,320,75,'c = ')[blue, hidden]; $LUpp FixedPoint(0,386)[hidden]; $LLow FixedPoint(0,420)[hidden]; $RLow FixedPoint(406,420)[hidden]; $RUpp FixedPoint(406,386)[hidden]; $ULine Line($LUpp,$RUpp)[black, hidden]; $RectA Polygon($LUpp,$LLow,$RLow,$RUpp,$LUpp)[yellow,hidden]; $SBRL ShowButton( 0,365,'Scale eqs')($RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; $HBRL HideButton(62,365,'Fix')( $RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; ${ The Plane Coordinate System $} $O FixedPoint(200, 200) [black, label('0'),hidden]; $unitp UnitPoint($O, 40) [white, label('1'),hidden]; $ykk FixedPoint(240,200)[white, label('1'),hidden]; $coord Origin&Unit($O, $unitp)[black,hidden]; $Xax AxisX($coord)[black,hidden]; $Yax AxisY($coord)[black,hidden]; $Sunit Segment($O,$unitp)[hidden]; $P1 Point(180,200)[red, label('P1'), hidden]; $Cir Circle by radius($P1,$Sunit)[red, hidden]; $P2 Point on object($Cir, 1.7)[red, label('P2'),hidden]; $LP1P2 Line($P1,$P2)[red]; $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(220,200)[color(0,150,0), label('Q1'), hidden]; $Cir Circle by radius($Q1,$Sunit)[color(0,150,0), hidden]; $Q2 Point on object($Cir, -1.7)[color(0,150,0), label('Q2'),hidden]; $LQ1Q2 Line($Q1,$Q2)[color(0,150,0)]; $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(200,270)[blue, label('R1'), hidden]; $Cir Circle by radius($R1,$Sunit)[blue, hidden]; $R2 Point on object($Cir, 1)[blue, label('R2'),hidden]; $LR1R2 Line($R1,$R2)[blue]; $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), hidden]; $xtr PlotXY($x2,$coord,$x1)[magenta, label('x'), layer(10), traced, hidden]; $Cx Coordinates($x,$coord,5,195,'x = ')[magenta, bold,hidden]; $dist Distance( $MP, $x, 0, 50, 'et = ') [blue,hidden]; $flag Calculate( 0, 70, 'luku = ','2 3 A- @sqrt 0.000001 * +')($dist)[red,hidden]; $vastx Translation/FixedAngle/MarkedDistance($x, $flag,0)[red,label('x0 ICI!'),layer(20)]; $Cvastx Coordinates($vastx,$coord,5,195,'x0 = ')[magenta, bold]; ${ $SBxtr ShowButton( 0,160,'Trace x0')($xtr)[magenta,hidden]; $HBxtr HideButton(57,160,'Stop')($xtr)[magenta,hidden]; $SBeq ShowButton(0,0,'Equations')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3)[black,bold,hidden]; $HBeq HideButton(70,0,'Hide')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3)[black,bold,hidden]; $}

Puzzle 3 Problem

Try to find the least squares solution x0 of the system of the equations for the lines in the Sketch.

Give the coordinates of x0:



Puzzle 4

${ Puzzle 4 $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 400 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 230 *BackGreen = 255 *Backred = 255 $MP FixedPoint(200,250)[black,label('x0''')]; ${ $reset FixedText(385,15,'Reset = ''R''')[black,bold,justifyRight]; $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ for scaling $} $RO FixedPoint(200,400)[black,label('0'),hidden]; $Ref Translation($RO,40,0)[hidden]; $Ray Ray($Ref,$RO)[black, hidden]; $Rykk Point on object($Ray,1)[white, label('1'), hidden]; $R1 FixedPoint(240,400)[white,label('1'),hidden]; $RL Line($Rykk,$RO)[black,hidden]; $Rpta Point on object($RL,1)[label('a'), red, layer(10), hidden]; $Ra Ratio/Points($RO,$Rykk,$Rpta,320,35,'a = ')[red, hidden]; $Rptb Point on object($RL,1)[label('b'), color(0,150,0), layer(15), hidden]; $Rb Ratio/Points($RO,$Rykk,$Rptb,320,55,'b = ')[color(0,150,0), hidden]; $Rptc Point on object($RL,1)[label('c'), blue, layer(20), hidden]; $Rc Ratio/Points($RO,$Rykk,$Rptc,320,75,'c = ')[blue, hidden]; $LUpp FixedPoint(0,386)[hidden]; $LLow FixedPoint(0,420)[hidden]; $RLow FixedPoint(406,420)[hidden]; $RUpp FixedPoint(406,386)[hidden]; $ULine Line($LUpp,$RUpp)[black, hidden]; $RectA Polygon($LUpp,$LLow,$RLow,$RUpp,$LUpp)[yellow,hidden]; $SBRL ShowButton( 0,365,'Scale eqs')($RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; $HBRL HideButton(62,365,'Fix')( $RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; ${ The Plane Coordinate System $} $O FixedPoint(200, 200) [black, label('0'),hidden]; $unitp UnitPoint($O, 40) [white, label('1'),hidden]; $ykk FixedPoint(240,200)[white, label('1'),hidden]; $coord Origin&Unit($O, $unitp)[black,hidden]; $Xax AxisX($coord)[black,hidden]; $Yax AxisY($coord)[black,hidden]; $Sunit Segment($O,$unitp)[hidden]; $P1 Point(180,200)[red, label('P1')]; $Cir Circle by radius($P1,$Sunit)[red, hidden]; $P2 Point on object($Cir, 1.7)[red, label('P2')]; $LP1P2 Line($P1,$P2)[red]; $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(250,200)[color(0,150,0), label('Q1'), hidden]; $Cir Circle by radius($Q1,$Sunit)[color(0,150,0), hidden]; $Q2 Point on object($Cir, -1.7)[color(0,150,0), label('Q2'),hidden]; $LQ1Q2 Line($Q1,$Q2)[color(0,150,0)]; $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(220,340)[blue, label('R1'), hidden]; $Cir Circle by radius($R1,$Sunit)[blue, hidden]; $R2 Point on object($Cir, 0)[blue, label('R2'),hidden]; $LR1R2 Line($R1,$R2)[blue]; $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('x0'), layer(10)]; $xtr PlotXY($x2,$coord,$x1)[magenta, label('x0'), layer(10), traced, hidden]; $Cx Coordinates($x,$coord,5,195,'x = ')[magenta, bold,hidden]; $dist Distance( $MP, $x, 0, 50, 'et = ') [blue,hidden]; $flag Calculate( 0, 70, 'luku = ','1 1 A- @sqrt 0.000001 * +')($dist)[red,hidden]; $vastx Translation/FixedAngle/MarkedDistance($x, $flag,0)[red,label('x0 ICI!'),layer(20)]; $Cvastx Coordinates($vastx,$coord,5,195,'x = ')[magenta, bold]; $SBxtr ShowButton( 0,160,'Trace x')($xtr)[magenta,hidden]; $HBxtr HideButton(57,160,'Stop')($xtr)[magenta,hidden]; $SBeq ShowButton(0,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,hidden];

Puzzle 4 Problem


Here you can move one of the lines by dragging the points P1 and P2.
Try to find such equations for the first line so that the Least Squares Solution x0 is the given black point x0'.

Give your equations:


Are there many different solutions?

Puzzle 5

${ Puzzle 5 $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 400 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 230 *BackGreen = 255 *Backred = 255 $MP FixedPoint(200,250)[black,label('x0''')]; ${ $reset FixedText(385,15,'Reset = ''R''')[black,bold,justifyRight]; $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ for scaling $} $RO FixedPoint(200,400)[black,label('0'),hidden]; $Ref Translation($RO,40,0)[hidden]; $Ray Ray($Ref,$RO)[black, hidden]; $Rykk Point on object($Ray,1)[white, label('1'), hidden]; $R1 FixedPoint(240,400)[white,label('1'),hidden]; $RL Line($Rykk,$RO)[black,hidden]; $Rpta Point on object($RL,1)[label('a'), red, layer(10), hidden]; $Ra Ratio/Points($RO,$Rykk,$Rpta,320,35,'a = ')[red, hidden]; $Rptb Point on object($RL,1)[label('b'), color(0,150,0), layer(15), hidden]; $Rb Ratio/Points($RO,$Rykk,$Rptb,320,55,'b = ')[color(0,150,0), hidden]; $Rptc Point on object($RL,1)[label('c'), blue, layer(20), hidden]; $Rc Ratio/Points($RO,$Rykk,$Rptc,320,75,'c = ')[blue, hidden]; $LUpp FixedPoint(0,386)[hidden]; $LLow FixedPoint(0,420)[hidden]; $RLow FixedPoint(406,420)[hidden]; $RUpp FixedPoint(406,386)[hidden]; $ULine Line($LUpp,$RUpp)[black, hidden]; $RectA Polygon($LUpp,$LLow,$RLow,$RUpp,$LUpp)[yellow,hidden]; $SBRL ShowButton( 0,365,'Scale eqs')($RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; $HBRL HideButton(62,365,'Fix')( $RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; ${ The Plane Coordinate System $} $O FixedPoint(200, 200) [black, label('0'),hidden]; $unitp UnitPoint($O, 40) [white, label('1'),hidden]; $ykk FixedPoint(240,200)[white, label('1'),hidden]; $coord Origin&Unit($O, $unitp)[black,hidden]; $Xax AxisX($coord)[black,hidden]; $Yax AxisY($coord)[black,hidden]; $Sunit Segment($O,$unitp)[hidden]; $P1 Point(180,200)[red, label('P1')]; $Cir Circle by radius($P1,$Sunit)[red, hidden]; $P2 Point on object($Cir, 1.7)[red, label('P2')]; $LP1P2 Line($P1,$P2)[red]; $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(250,200)[color(0,150,0), label('Q1')]; $Cir Circle by radius($Q1,$Sunit)[color(0,150,0), hidden]; $Q2 Point on object($Cir, -1.7)[color(0,150,0), label('Q2')]; $LQ1Q2 Line($Q1,$Q2)[color(0,150,0)]; $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(220,340)[blue, label('R1'), hidden]; $Cir Circle by radius($R1,$Sunit)[blue, hidden]; $R2 Point on object($Cir, 0)[blue, label('R2'),hidden]; $LR1R2 Line($R1,$R2)[blue]; $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('x0'), layer(10)]; $xtr PlotXY($x2,$coord,$x1)[magenta, label('x0'), layer(10), traced, hidden]; $Cx Coordinates($x,$coord,5,195,'x = ')[magenta, bold,hidden]; $dist Distance( $MP, $x, 0, 50, 'et = ') [blue,hidden]; $flag Calculate( 0, 70, 'luku = ','1 1 A- @sqrt 0.000001 * +')($dist)[red,hidden]; $vastx Translation/FixedAngle/MarkedDistance($x, $flag,0)[red,label('x0 ICI!'),layer(20)]; $Cvastx Coordinates($vastx,$coord,5,195,'x = ')[magenta, bold]; $SBxtr ShowButton( 0,160,'Trace x')($xtr)[magenta,hidden]; $HBxtr HideButton(57,160,'Stop')($xtr)[magenta,hidden]; $SBeq ShowButton(0,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,hidden];

Puzzle 5 Problem


Here you can move two of the lines by dragging the points P1, P2, Q1 and Q2.
Try to find such positions for the lines that the Least Squares Solution x0 is the given black point x0'.

Are there many different solutions?



Puzzle 6

${ Puzzle 6 $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 400 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 230 *BackGreen = 255 *Backred = 255 $MP FixedPoint(200,250)[black,label('x0''')]; ${ $reset FixedText(385,15,'Reset = ''R''')[black,bold,justifyRight]; $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ for scaling $} $RO FixedPoint(200,400)[black,label('0'),hidden]; $Ref Translation($RO,40,0)[hidden]; $Ray Ray($Ref,$RO)[black, hidden]; $Rykk Point on object($Ray,1)[white, label('1'), hidden]; $R1 FixedPoint(240,400)[white,label('1'),hidden]; $RL Line($Rykk,$RO)[black,hidden]; $Rpta Point on object($RL,1)[label('a'), red, layer(10), hidden]; $Ra Ratio/Points($RO,$Rykk,$Rpta,320,35,'a = ')[red, hidden]; $Rptb Point on object($RL,1)[label('b'), color(0,150,0), layer(15), hidden]; $Rb Ratio/Points($RO,$Rykk,$Rptb,320,55,'b = ')[color(0,150,0), hidden]; $Rptc Point on object($RL,1)[label('c'), blue, layer(20), hidden]; $Rc Ratio/Points($RO,$Rykk,$Rptc,320,75,'c = ')[blue, hidden]; $LUpp FixedPoint(0,386)[hidden]; $LLow FixedPoint(0,420)[hidden]; $RLow FixedPoint(406,420)[hidden]; $RUpp FixedPoint(406,386)[hidden]; $ULine Line($LUpp,$RUpp)[black, hidden]; $RectA Polygon($LUpp,$LLow,$RLow,$RUpp,$LUpp)[yellow,hidden]; $SBRL ShowButton( 0,365,'Scale eqs')($RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; $HBRL HideButton(62,365,'Fix')( $RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$RectA)[black, hidden]; ${ The Plane Coordinate System $} $O FixedPoint(200, 200) [black, label('0'),hidden]; $unitp UnitPoint($O, 40) [white, label('1'),hidden]; $ykk FixedPoint(240,200)[white, label('1'),hidden]; $coord Origin&Unit($O, $unitp)[black,hidden]; $Xax AxisX($coord)[black,hidden]; $Yax AxisY($coord)[black,hidden]; $Sunit Segment($O,$unitp)[hidden]; $P1 Point(180,200)[red, label('P1')]; $Cir Circle by radius($P1,$Sunit)[red, hidden]; $P2 Point on object($Cir, 1.7)[red, label('P2')]; $LP1P2 Line($P1,$P2)[red]; $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(250,200)[color(0,150,0), label('Q1')]; $Cir Circle by radius($Q1,$Sunit)[color(0,150,0), hidden]; $Q2 Point on object($Cir, -1.7)[color(0,150,0), label('Q2')]; $LQ1Q2 Line($Q1,$Q2)[color(0,150,0)]; $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(220,340)[blue, label('R1')]; $Cir Circle by radius($R1,$Sunit)[blue, hidden]; $R2 Point on object($Cir, 0)[blue, label('R2')]; $LR1R2 Line($R1,$R2)[blue]; $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('x0'), layer(10)]; $xtr PlotXY($x2,$coord,$x1)[magenta, label('x0'), layer(10), traced, hidden]; $Cx Coordinates($x,$coord,5,195,'x = ')[magenta, bold,hidden]; $dist Distance( $MP, $x, 0, 50, 'et = ') [blue,hidden]; $flag Calculate( 0, 70, 'luku = ','2 2 A- @sqrt 0.000001 * +')($dist)[red,hidden]; $vastx Translation/FixedAngle/MarkedDistance($x, $flag,0)[red,label('x0 ICI!'),layer(20)]; $Cvastx Coordinates($vastx,$coord,5,195,'x = ')[magenta, bold]; $SBxtr ShowButton( 0,160,'Trace x')($xtr)[magenta,hidden]; $HBxtr HideButton(57,160,'Stop')($xtr)[magenta,hidden]; $SBeq ShowButton(0,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,hidden];

Puzzle 6 Problem


Here you can move all the lines.
Try to find such positions for the lines that
- the Least Squares Solution x0 is the given black point x0' and
- turning lines does not make the solution move.

Are there many different solutions?


What can you say about this (or these) solutions?

3. Solutions for systems of four equations

${ Solutions for systems of four equations $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 406 #HEIGHT = 420 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 255 *BackGreen = 230 *Backred = 255 $reset FixedText(385,15,'Reset = ''R''')[black,bold,justifyRight]; $Clear FixedText(370,412,'Clear trace x ->')[red,plain,font('Courier'),bold,justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; ${ for scaling $} $RO FixedPoint(200,400)[black,label('0'),hidden]; $Ref Translation($RO,40,0)[hidden]; $Ray Ray($Ref,$RO)[black, hidden]; $Rykk Point on object($Ray,1)[white, label('1'), hidden]; $R1 FixedPoint(240,400)[white,label('1'),hidden]; $RL Line($Rykk,$RO)[black,hidden]; $Rpta Point on object($RL,1)[label('a'), red, layer(10), hidden]; $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]; $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]; $Rc Ratio/Points($RO,$Rykk,$Rptc,320,75,'c = ')[blue]; $Rptd Point on object($RL,4)[label('d'), color(128,128,128), layer(25), hidden]; $Rd Ratio/Points($RO,$Rykk,$Rptd,320,95,'d = ')[color(128,128,128)]; $LUpp FixedPoint(0,386)[hidden]; $LLow FixedPoint(0,420)[hidden]; $RLow FixedPoint(406,420)[hidden]; $RUpp FixedPoint(406,386)[hidden]; $ULine Line($LUpp,$RUpp)[black]; $RectA Polygon($LUpp,$LLow,$RLow,$RUpp,$LUpp)[yellow,hidden]; $SBRL ShowButton( 0,365,'Scale eqs')($RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$Rptd,$RectA)[black]; $HBRL HideButton(62,365,'Fix')( $RO,$R1,$RL,$Rpta,$Rptb,$Rptc,$Rptd,$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]; $Sunit Segment($O,$unitp)[hidden]; $P1 Point(200,160)[red, label('P1')]; $Cir Circle by radius($P1,$Sunit)[red, hidden]; $P2 Point on object($Cir, 1)[red, label('P2')]; $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')]; $Cir Circle by radius($Q1,$Sunit)[color(0,150,0), hidden]; $Q2 Point on object($Cir, 3)[color(0,150,0), label('Q2')]; $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')]; $Cir Circle by radius($R1,$Sunit)[blue, hidden]; $R2 Point on object($Cir, 5)[blue, label('R2')]; $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]; $S1 Point(200,240)[color(128,128,128), label('S1')]; $Cir Circle by radius($S1,$Sunit)[color(128,128,128), hidden]; $S2 Point on object($Cir, 7)[color(128,128,128), label('S2')]; $LS1S2 Line($S1,$S2)[color(128,128,128),hidden]; $CoS1 Coordinates($S1,$coord,20,100,'S1 = ')[color(128,128,128),hidden]; $CoS2 Coordinates($S2,$coord,20,60,'S2 = ')[color(128,128,128),hidden]; $a41pr Calculate( 0,95,'','#B2 #A2 -')($CoS1,$CoS2)[color(128,128,128),suffix('x'), hidden]; $a42pr Calculate( 57,95,'+(','#A1 #B1 -')($CoS1,$CoS2)[color(128,128,128),suffix(')y = '), hidden]; $b4pr Calculate(152,95,'','#B2#A2- #A1* #B1#A1- #A2* -')($CoS1,$CoS2)[color(128,128,128), hidden]; $a41 Calculate( 0,95,'','AB*')($a41pr,$Rd)[color(128,128,128), suffix('x'), hidden]; $a42 Calculate(57,95,'+(','AB*')($a42pr,$Rd)[color(128,128,128), suffix(')y = '), hidden]; $b4 Calculate(152,95,'','AB*')($b4pr,$Rd)[color(128,128,128), hidden]; $A Calculate(205, 10,'A = ','A2^ B2^ + C2^ + D2^ +')($a11,$a21,$a31,$a41)[black,hidden]; $B Calculate(205, 25,'B = ','AE* BF* + CG* + DH* +')($a11,$a21,$a31,$a41,$a12,$a22,$a32,$a42)[black,hidden]; $C Calculate(205, 40,'C = ','A2^ B2^ + C2^ + D2^ +')($a12,$a22,$a32,$a42)[black,hidden]; $D Calculate(205, 55,'D = ','AE* BF* + CG* + DH* +')($a11,$a21,$a31,$a41,$b1,$b2,$b3,$b4)[black,hidden]; $E Calculate(205, 70,'E = ','AE* BF* + CG* + DH* +')($a12,$a22,$a32,$a42,$b1,$b2,$b3,$b4)[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('x0'), layer(10)]; $xtr PlotXY($x2,$coord,$x1)[magenta, label('x0'),traced, hidden]; $Cx Coordinates($x,$coord,5,155,'x = ')[magenta,bold]; $SBxtr ShowButton( 0,120,'Trace x')($xtr)[blue]; $HBxtr HideButton(55,120,'Stop')($xtr)[blue]; $SBeq ShowButton(0,0,'Equations')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3,$a41,$a42,$b4)[black,bold]; $HBeq HideButton(70,0,'Hide')($a11,$a12,$b1,$a21,$a22,$b2,$a31,$a32,$b3,$a41,$a42,$b4)[black,bold]; $YV FixedPoint(0,0)[hidden]; $YO FixedPoint(406,0)[hidden]; $AV FixedPoint(0,386)[hidden]; $AO FixedPoint(406,386)[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]; Segment($IYLP1P2,$IALP1P2)[red]; Segment($IYLP1P2,$IVLP1P2)[red]; Segment($IYLP1P2,$IOLP1P2)[red]; Segment($IALP1P2,$IVLP1P2)[red]; Segment($IOLP1P2,$IVLP1P2)[red]; Segment($IALP1P2,$IOLP1P2)[red]; $IYLQ1Q2 Intersect($LYVYO,$LQ1Q2)[hidden]; $IALQ1Q2 Intersect($LAVAO,$LQ1Q2)[hidden]; $IVLQ1Q2 Intersect($LYVAV,$LQ1Q2)[hidden]; $IOLQ1Q2 Intersect($LYOAO,$LQ1Q2)[hidden]; Segment($IYLQ1Q2,$IALQ1Q2)[color(0,150,0)]; Segment($IYLQ1Q2,$IVLQ1Q2)[color(0,150,0)]; Segment($IYLQ1Q2,$IOLQ1Q2)[color(0,150,0)]; Segment($IALQ1Q2,$IVLQ1Q2)[color(0,150,0)]; Segment($IOLQ1Q2,$IVLQ1Q2)[color(0,150,0)]; Segment($IALQ1Q2,$IOLQ1Q2)[color(0,150,0)]; $IYLR1R2 Intersect($LYVYO,$LR1R2)[hidden]; $IALR1R2 Intersect($LAVAO,$LR1R2)[hidden]; $IVLR1R2 Intersect($LYVAV,$LR1R2)[hidden]; $IOLR1R2 Intersect($LYOAO,$LR1R2)[hidden]; Segment($IYLR1R2,$IALR1R2)[blue]; Segment($IYLR1R2,$IVLR1R2)[blue]; Segment($IYLR1R2,$IOLR1R2)[blue]; Segment($IALR1R2,$IVLR1R2)[blue]; Segment($IOLR1R2,$IVLR1R2)[blue]; Segment($IALR1R2,$IOLR1R2)[blue]; $IYLS1S2 Intersect($LYVYO,$LS1S2)[hidden]; $IALS1S2 Intersect($LAVAO,$LS1S2)[hidden]; $IVLS1S2 Intersect($LYVAV,$LS1S2)[hidden]; $IOLS1S2 Intersect($LYOAO,$LS1S2)[hidden]; Segment($IYLS1S2,$IALS1S2)[color(128,128,128)]; Segment($IYLS1S2,$IVLS1S2)[color(128,128,128)]; Segment($IYLS1S2,$IOLS1S2)[color(128,128,128)]; Segment($IALS1S2,$IVLS1S2)[color(128,128,128)]; Segment($IOLS1S2,$IVLS1S2)[color(128,128,128)]; Segment($IALS1S2,$IOLS1S2)[color(128,128,128)]; In this Sketch you can make parallel moves for the lines by dragging with the computer mouse the points P1, Q1, R1 and S1. You can turn the lines around with the points P2, Q2, R2 and S2
Also you can multiply the equations by numbers a, b, c and d. Try all the buttons in the Sketch.

Problem

Describe all possible positions of x0 for the 4 given lines when a, b, c and d belong to R3.

III Normalizing the Least Squares Solution of lines

1. Description of the problem

Let a1, b1, c1, k1, a2, b2, c2, k2, a3, b3, c3, k3, be real numbers such that
a12 + b12 = a22 + b22 = a32 + b32 = 1.
We call d1, d2 and d3 the straight lines of equations
ì
ï
í
ï
î
k1 a1 x1
+
k1 b1 x2
=
k1 c1
k2 a2 x1
+
k2 b2 x2
=
k2 c2
k3 a3 x1
+
k3 b3 x2
=
k3 c3
Note that in the Java Sketches the scaling numbers k1, k2 and k3 are denoted by a, b and c.

The lines form a triangle of vertices S1 = d2Çd3, S2 = d3Çd1 and S3 = d1Çd2, see Figure 1.

Triangle
Figure 1: The triangle

We define
x = æ
ç
è
x1
x2
ö
÷
ø
,   c = æ
ç
ç
ç
è
k1 c1
k2 c2
k3 c3
ö
÷
÷
÷
ø
,   A = æ
ç
ç
ç
è
k1 a1
k1 b1
k2 a2
k2 b2
k3 a3
k3 b3
ö
÷
÷
÷
ø
The matrix equation Ax = C has in general no solution. The least squares solution x0 of the normal equation
AT A x = AT c
is such that
F(x) = F(x1,x2) = ||A x - c||2 = (xT AT - cT)(Ax - c)
is minimum for x = x0.

We denote by d(x,L) the distance from the point x to line L. If one computes F(x) one gets:
F(x) = k12 (d(x,d1))2+k22 (d(x,d2))2+k32 (d(x,d3))2

I Case k1 = k2 = k3

The function to be minimized is
F(x) = (d(x,d1))2+(d(x,d2))2+(d(x,d3))2
Let us call l1 = S2 S3, l2 = S3 S1 and l3 = S1 S2, the lengths of the sides of the triangle defined by the lines d1, d2 and d3. The point x0 such that F(x) is minimum for x = x0 is the barycenter of S1, S2 and S3 with masses l12, l22 and l32:
x0 =  l12

l12+l22+l32
S1+  l22

l12+l22+l32
S2+  l32

l12+l22+l32
S3

Problems

1. If the triangle defined by the lines d1, d2 and d3 is isosceles (let us say S1 S2 = S1 S3), on what line do you expect to find x0 (see Figure 2) ?

Isosceles
Figure 2: Isosceles triangle

2. If the triangle is equilateral where is x0?

3. The distances of x0 to the sides of the triangle are proportional to the lengths of the corresponding sides to a certain power r:
 d(x0,d1)

l1r
=  d(x0,d2)

l2r
=  d(x0,d3)

l3r
Guess what is the value of r?

Note: If r = -1, the point x0 would be the center of gravity; if r = 0, the point x0 would be the center of the inner circle.

4. If the triangle is rectangular, e.g. d2 ^d3, on what line do you find x0 (see Figure 3) ?

Rectangular
Figure 3: Rectangular triangle


 H K2

S1 S3
=  H K3

S2 S1
 since the triangles are similar

IV Geometrical construction of LSQ-solution for three lines

1. Step by step construction from the point A

${ 1. Step by step construction from the point A $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 500 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 255 *BackGreen = 255 *Backred = 255 $reset FixedText(485,15,'Reset = ''R''')[black,bold,justifyRight]; ${ $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ The free points $} $A Point(260,200)[yellow, label('A')]; $B Point(240,240)[yellow, label('B')]; $C Point(295,250)[yellow, label('C')]; ${ The three lines $} $LBC Line($B,$C)[black]; $LCA Line($C,$A)[black]; $LAB Line($A,$B)[black]; ${ The triangle ABC coloured $} $Triang Polygon($A,$B,$C)[yellow]; ${ Construction from A $} $LperpCA Perpendicular($LCA,$C)[red,hidden]; $SBLperpCA ShowButton( 0, 24, 'Construct perpendicular line for CA at C')($LperpCA)[red]; $CircCA Circle($C,$A)[green,hidden]; $SBCircCA ShowButton( 0, 44, 'Draw circle at C from A')($CircCA)[red]; $C1 Intersect2($LperpCA,$CircCA)[red,label('C1'),hidden]; $SBC1 ShowButton( 0, 64, 'Their intersection')($C1)[red]; $LparCA Parallel($LCA,$C1)[red,hidden]; $SBLparCA ShowButton( 0, 84, 'Construct at C1 line parallel to CA')($LparCA)[red]; $HBstepCA HideButton( 0,104, 'Hide')($CircCA,$LperpCA)[black]; $LperpBA Perpendicular($LAB,$B)[blue,hidden]; $SBLperpBA ShowButton( 0, 130, 'Construct perpendicular line for AB at B')($LperpBA)[blue]; $CircBA Circle($B,$A)[green,hidden]; $SBCircBA ShowButton( 0, 150, 'Draw circle at B from A')($CircBA)[blue]; $B1 Intersect2($LperpBA,$CircBA)[blue,label('B1'),hidden]; $SBB1 ShowButton( 0, 170, 'Their intersection')($B1)[blue]; $LparBA Parallel($LAB,$B1)[blue,hidden]; $SBLparBA ShowButton( 0, 190, 'Construct at B1 line parallel to BA')($LparBA)[blue]; $HBstepBA HideButton( 0,210, 'Hide')($CircBA,$LperpBA)[black]; $O1 Intersect($LparCA,$LparBA)[magenta,label('O1'),hidden]; $LAO Line($A,$O1)[magenta,hidden]; $SBO1 ShowButton( 0, 240, 'Construct O1 line')($C1,$LparCA,$B1,$LparBA,$O1,$LAO)[magenta,bold]; $HB01 HideButton(120, 240, 'Hide others')($LperpCA,$CircCA,$C1,$LparCA,$LperpBA,$CircBA,$B1,$LparBA)[magenta]; $HB01b HideButton( 0, 262, 'Hide O1 line')($O1,$LAO)[magenta]; $SBButtons ShowButton( 0, 0, 'Construction buttons')($SBLperpCA,$SBCircCA,$SBC1,$SBLparCA,$HBstepCA,$SBLperpBA,$SBCircBA,$SBB1,$SBLparBA,$SBLparBA,$HBstepBA,$SBO1,$HB01,$HB01b)[black,bold]; $HBButtons HideButton(140, 0, 'Hide buttons')( $SBLperpCA,$SBCircCA,$SBC1,$SBLparCA,$HBstepCA,$SBLperpBA,$SBCircBA,$SBB1,$SBLparBA,$SBLparBA,$HBstepBA,$SBO1,$HB01,$HB01b)[black,bold]; You can move the lines by dragging the intersections A, B and C.

With the Sketch control button you can see step by step:

- the point C1 and the line parallel to line CA at distance |AC|
- the point B1 and the line parallel to line AB at distance |AB|
- the intersecting point O1 and the line joining it to A

2. stage of the construction: from the point B

${ 2. stage of the construction: from the point B $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 500 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 255 *BackGreen = 255 *Backred = 255 $reset FixedText(485,15,'Reset = ''R''')[black,bold,justifyRight]; ${ $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ The free points $} $A Point(260,200)[yellow, label('A')]; $B Point(240,240)[yellow, label('B')]; $C Point(295,250)[yellow, label('C')]; ${ The three lines $} $LBC Line($B,$C)[black]; $LCA Line($C,$A)[black]; $LAB Line($A,$B)[black]; ${ The triangle ABC coloured $} $Triang Polygon($A,$B,$C)[yellow]; ${ Construction from B $} $LperpAB Perpendicular($LAB,$A)[red,hidden]; $CircAB Circle($A,$B)[green,hidden]; $A2 Intersect2($LperpAB,$CircAB)[red,label('A2'),hidden]; $LparAB Parallel($LAB,$A2)[red,hidden]; $SBAB ShowButton( 0, 0, 'Construct A2 line')($LperpAB,$CircAB,$A2,$LparAB)[red,bold]; $HBAB HideButton(120, 0, 'Hide')($LperpAB,$CircAB)[red]; $LperpCB Perpendicular($LBC,$C)[blue,hidden]; $CircCB Circle($C,$B)[green,hidden]; $C2 Intersect2($LperpCB,$CircCB)[blue,label('C2'),hidden]; $LparCB Parallel($LBC,$C2)[blue,hidden]; $SBCB ShowButton( 0, 20, 'Construct C2 line')($LperpCB,$CircCB,$C2,$LparCB)[blue,bold]; $HBCB HideButton(120, 20, 'Hide')($LperpCB,$CircCB)[blue]; $O2 Intersect($LparAB,$LparCB)[magenta,label('O2'),hidden]; $LBO Line($B,$O2)[magenta,hidden]; $SBO2 ShowButton( 0, 40, 'Construct O2 line')($A2,$LparAB,$C2,$LparCB,$O2,$LBO)[magenta,bold]; $HB02 HideButton(120, 40, 'Hide others')($LperpAB,$CircAB,$A2,$LparAB,$LperpCB,$CircCB,$C2,$LparCB)[magenta]; $HB02b HideButton( 0, 60, 'Hide O2 line')($O2,$LBO)[magenta]; You can move the lines by dragging the intersections A, B and C.

With the Sketch control button you can show and hide the three steps:

- the point A2 and the line parallel to line AB at distance |AB|
- the point C2 and the line parallel to line BC at distance |BC|
- the intersecting point O2 and the line joining it to B

3. stage of the construction: from the point C

${ 3. stage of the construction: from the point C $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 500 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 255 *BackGreen = 255 *Backred = 255 $reset FixedText(485,15,'Reset = ''R''')[black,bold,justifyRight]; ${ $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ The free points $} $A Point(260,200)[yellow, label('A')]; $B Point(240,240)[yellow, label('B')]; $C Point(295,250)[yellow, label('C')]; ${ The three lines $} $LBC Line($B,$C)[black]; $LCA Line($C,$A)[black]; $LAB Line($A,$B)[black]; ${ The triangle ABC coloured $} $Triang Polygon($A,$B,$C)[yellow]; ${ Construction from C $} $LperpAC Perpendicular($LCA,$A)[red,hidden]; $CircAC Circle($A,$C)[green,hidden]; $A3 Intersect2($LperpAC,$CircAC)[red,label('A3'),hidden]; $LparAC Parallel($LCA,$A3)[red,hidden]; $SBAC ShowButton( 0, 0, 'Construct A3 line')($LperpAC,$CircAC,$A3,$LparAC)[red,bold]; $HBAC HideButton(120, 0, 'Hide')($LperpAC,$CircAC)[red]; $LperpBC Perpendicular($LBC,$B)[blue,hidden]; $CircBC Circle($B,$C)[green,hidden]; $B3 Intersect2($LperpBC,$CircBC)[blue,label('B3'),hidden]; $LparBC Parallel($LBC,$B3)[blue,hidden]; $SBBC ShowButton( 0, 20, 'Construct B3 line')($LperpBC,$CircBC,$B3,$LparBC)[blue,bold]; $HBBC HideButton(120, 20, 'Hide')($LperpBC,$CircBC)[blue]; $O3 Intersect($LparAC,$LparBC)[magenta,label('O3'),hidden]; $LCO Line($C,$O3)[magenta,hidden]; $SBO3 ShowButton( 0, 40, 'Construct O3 line')($A3,$LparAC,$B3,$LparBC,$O3,$LCO)[magenta,bold]; $HBO3 HideButton(120, 40, 'Hide others')($LperpAC,$CircAC,$A3,$LparAC,$LperpBC,$CircBC,$B3,$LparBC)[magenta]; $HBO3b HideButton( 0, 60, 'Hide O3 line')($O3,$LCO)[magenta]; You can move the lines by dragging the intersections A, B and C.

With the Sketch control button you can show and hide the three steps:

- the point A3 and the line parallel to line CA at distance |CA|
- the point B3 and the line parallel to line BC at distance |BC|
- the intersecting point O3 and the line joining it to C

4. All constructions from A, B and C

${ 4. All constructions from A, B and C $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 500 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 255 *BackGreen = 255 *Backred = 255 $reset FixedText(485,15,'Reset = ''R''')[black,bold,justifyRight]; ${ $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ The free points $} $A Point(260,200)[yellow, label('A')]; $B Point(240,240)[yellow, label('B')]; $C Point(295,250)[yellow, label('C')]; ${ The three lines $} $LBC Line($B,$C)[black]; $LCA Line($C,$A)[black]; $LAB Line($A,$B)[black]; ${ The triangle ABC coloured $} $Triang Polygon($A,$B,$C)[yellow]; ${ Construction from A $} $LperpCA Perpendicular($LCA,$C)[red,hidden]; $CircCA Circle($C,$A)[green,hidden]; $C1 Intersect2($LperpCA,$CircCA)[red,label('C1'),hidden]; $LparCA Parallel($LCA,$C1)[red,hidden]; $SBCA ShowButton( 0, 0, 'Construct C1 line')($LperpCA,$CircCA,$C1,$LparCA)[red,bold]; $HBCA HideButton(120, 0, 'Hide')($LperpCA,$CircCA)[red]; $LperpBA Perpendicular($LAB,$B)[blue,hidden]; $CircBA Circle($B,$A)[green,hidden]; $B1 Intersect2($LperpBA,$CircBA)[blue,label('B1'),hidden]; $LparBA Parallel($LAB,$B1)[blue,hidden]; $SBBA ShowButton( 0, 20, 'Construct B1 line')($LperpBA,$CircBA,$B1,$LparBA)[blue,bold]; $HBBA HideButton(120, 20, 'Hide')($LperpBA,$CircBA)[blue]; $O1 Intersect($LparCA,$LparBA)[magenta,label('O1'),hidden]; $LAO Line($A,$O1)[magenta,hidden]; $SBO1 ShowButton( 0, 40, 'Construct O1 line')($C1,$LparCA,$B1,$LparBA,$O1,$LAO)[magenta,bold]; $HB01 HideButton(120, 40, 'Hide others')($LperpCA,$CircCA,$C1,$LparCA,$LperpBA,$CircBA,$B1,$LparBA)[magenta]; $HB01b HideButton( 0, 60, 'Hide O1 line')($O1,$LAO)[magenta]; ${ Construction from B $} $LperpAB Perpendicular($LAB,$A)[red,hidden]; $CircAB Circle($A,$B)[green,hidden]; $A2 Intersect2($LperpAB,$CircAB)[red,label('A2'),hidden]; $LparAB Parallel($LAB,$A2)[red,hidden]; $SBAB ShowButton( 0,100, 'Construct A2 line')($LperpAB,$CircAB,$A2,$LparAB)[red,bold]; $HBAB HideButton(120,100, 'Hide')($LperpAB,$CircAB)[red]; $LperpCB Perpendicular($LBC,$C)[blue,hidden]; $CircCB Circle($C,$B)[green,hidden]; $C2 Intersect2($LperpCB,$CircCB)[blue,label('C2'),hidden]; $LparCB Parallel($LBC,$C2)[blue,hidden]; $SBCB ShowButton( 0,120, 'Construct C2 line')($LperpCB,$CircCB,$C2,$LparCB)[blue,bold]; $HBCB HideButton(120,120, 'Hide')($LperpCB,$CircCB)[blue]; $O2 Intersect($LparAB,$LparCB)[magenta,label('O2'),hidden]; $LBO Line($B,$O2)[magenta,hidden]; $SBO2 ShowButton( 0,140, 'Construct O2 line')($A2,$LparAB,$C2,$LparCB,$O2,$LBO)[magenta,bold]; $HB02 HideButton(120,140, 'Hide others')($LperpAB,$CircAB,$A2,$LparAB,$LperpCB,$CircCB,$C2,$LparCB)[magenta]; $HB02b HideButton( 0,160, 'Hide O2 line')($O2,$LBO)[magenta]; $IintAOBO Intersect($LAO,$LBO)[black,label('x0'),hidden]; $SBAOBO ShowButton( 0,190, 'Intersection x0')($O1,$LAO,$O2,$LBO,$IintAOBO)[black,bold]; $HBAOBO HideButton(120,190, 'Hide')($O1,$LAO,$O2,$LBO,$IintAOBO)[black]; ${ Construction from C $} $LperpAC Perpendicular($LCA,$A)[red,hidden]; $CircAC Circle($A,$C)[green,hidden]; $A3 Intersect2($LperpAC,$CircAC)[red,label('A3'),hidden]; $LparAC Parallel($LCA,$A3)[red,hidden]; $SBAC ShowButton( 0,220, 'Construct A3 line')($LperpAC,$CircAC,$A3,$LparAC)[red,bold]; $HBAC HideButton(120,220, 'Hide')($LperpAC,$CircAC)[red]; $LperpBC Perpendicular($LBC,$B)[blue,hidden]; $CircBC Circle($B,$C)[green,hidden]; $B3 Intersect2($LperpBC,$CircBC)[blue,label('B3'),hidden]; $LparBC Parallel($LBC,$B3)[blue,hidden]; $SBBC ShowButton( 0, 240, 'Construct B3 line')($LperpBC,$CircBC,$B3,$LparBC)[blue,bold]; $HBBC HideButton(120, 240, 'Hide')($LperpBC,$CircBC)[blue]; $O3 Intersect($LparAC,$LparBC)[magenta,label('O3'),hidden]; $LCO Line($C,$O3)[magenta,hidden]; $SBO3 ShowButton( 0, 260, 'Construct O3 line')($A3,$LparAC,$B3,$LparBC,$O3,$LCO)[magenta,bold]; $HBO3 HideButton(120, 260, 'Hide others')($LperpAC,$CircAC,$A3,$LparAC,$LperpBC,$CircBC,$B3,$LparBC)[magenta]; $HBO3b HideButton( 0, 280, 'Hide O3 line')($O3,$LCO)[magenta]; $SBall ShowButton( 0, 300, 'ALL')($O1,$LAO,$O2,$LBO,$O3,$LCO)[magenta,bold]; You can move the lines by dragging the intersections A, B and C.

Here you can see the intersection of the first two lines and then check whether also the third will fit.


Symmedian

${ Symmedian $} #CODE = "GSP.class" #CODEBASE = "..\jsp" #ARCHIVE = "jsp4.jar" #WIDTH = 400 #HEIGHT = 400 #ALIGN = Center *Frame = 1 *LabelFont = "Courier" *LabelBold = 1 *MeasureFont = "Courier" *MeasureSize = 14 *MeasureBold = 1 *MeasureInDegrees = 1 *DirectedAngles = 0 *Backblue = 255 *BackGreen = 255 *Backred = 255 $reset FixedText(385,15,'Reset = ''R''')[black,bold,justifyRight]; ${ $Clear FixedText(370,413,'Puhdistus: x ->')[red,plain,font('Courier'),justifyRight]; $xText FixedText(385,195,'x1')[bold, black, justifyCenter]; $yText FixedText(192, 10,'x2')[bold, black, justifyCenter]; $} ${ The free points $} $A Point(170,240)[yellow, label('A')]; $B Point(280,290)[yellow, label('B')]; $C Point(160,290)[yellow, label('C')]; ${ The three lines $} $LBC Line($B,$C)[black]; $LCA Line($C,$A)[black]; $LAB Line($A,$B)[black]; ${ The triangle ABC coloured $} $Triang Polygon($A,$B,$C)[yellow]; ${ Construction from A $} $LperpCA Perpendicular($LCA,$C)[red,hidden]; $CircCA Circle($C,$A)[yellow,hidden]; $C1 Intersect2($LperpCA,$CircCA)[red,label('C1'),hidden]; $LparCA Parallel($LCA,$C1)[red,hidden]; $LperpBA Perpendicular($LAB,$B)[blue,hidden]; $CircBA Circle($B,$A)[green,hidden]; $B1 Intersect2($LperpBA,$CircBA)[blue,label('B1'),hidden]; $LparAB Parallel($LAB,$B1)[blue,hidden]; $O1 Intersect($LparCA,$LparAB)[magenta,label('O1'),hidden]; $LAO Line($A,$O1)[magenta,hidden]; $( Angle Bisector (Side1, Vertex, Side2) ${ An Angle Bisector that behaves exactly as the GSP construction. See also the alternative construction in bisecto2.jsp. $} Translation ($Vertex, 10.0, 0.0) [hidden]; Circle ($Vertex, $1) [hidden,black]; Ray ($Side1, $Vertex) [hidden,black]; Ray ($Side2, $Vertex) [hidden,black]; Intersect2 ($2, $3) [hidden]; Intersect2 ($2, $4) [hidden]; Segment ($2, $1) [hidden,black]; Midpoint ($1) [hidden]; Ray($1, $Vertex); $) $ABis Angle Bisector($B,$A,$C)[green]; $L Intersect($LBC,$ABis)[green,label('L')]; $SBC Segment($B,$C)[hidden]; $Apr Midpoint($SBC)[cyan,label('A''')]; $SAApr Segment($A,$Apr)[cyan]; $RayApr Ray($Apr,$A)[cyan]; $RaySym Reflection($SAApr,$ABis)[cyan]; $P Intersect($LBC,$RaySym)[cyan,label('P')]; $BBis Angle Bisector($A,$B,$C)[blue,hidden]; $CircC Intersect($ABis,$BBis)[blue,hidden]; $PerpAB Perpendicular($LAB,$CircC)[blue,hidden]; $PtOnC Intersect($PerpAB,$LAB)[blue,hidden]; $InnerC Circle($CircC,$PtOnC)[cyan]; $SBO1 ShowButton( 0, 0, 'Construction from A')($LperpCA,$CircCA,$C1,$LparCA,$LperpBA,$CircBA,$B1,$LparAB,$O1,$LAO)[magenta,bold]; $HB01 HideButton(140, 0, 'Hide')($LperpCA,$CircCA,$C1,$LparCA,$LperpBA,$CircBA,$B1,$LparAB,$O1,$LAO)[magenta]; You can move the lines by dragging the intersections A, B and C.

Problems

The intersection of BC with Ax0 (or AO1) is denoted by P.

1. Show that b2 PB = c2 PC, where b = CA and c = AB.

2. Show that AP is a symmedian of the triangle ABC, that is the image of the median in the reflection along the inner bisector shown on the picture.

3. Are the three symmedians of a triangle concurrent?


Martti.Pesonen@Joensuu.Fi 2003