Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Lösung von P2 mit kleinsten Quadraten
SetDirectory@NotebookDirectory@DD�media�manfred�wd120a�Public�17.18.statlearn
Daten
Import@"http:��gruber.userweb.mwn.de�17.18.statlearn�17.18.10.P2.punkte.csv"D8810.1291, 10.7094<, 87.39324, 12.2047<, 811.7789, 8.37764<,
810.7244, 9.94977<, 85.60441, 12.6615<, 810.1236, 10.7326<,88.78503, 11.7883<, 86.99274, 12.2728<, 85.81048, 12.5204<, 812.0992, 8.01506<,85.56326, 12.7078<, 89.98997, 10.6254<, 89.4529, 11.2909<, 89.66751, 10.929<,88.17312, 11.9233<, 88.65314, 11.6441<, 87.39466, 12.1831<, 86.86538, 12.4858<,87.31823, 12.2729<, 810.3271, 10.446<, 811.3332, 9.32653<, 89.05241, 11.5063<,811.8809, 8.4599<, 86.58427, 12.5158<, 812.3069, 7.0755<, 89.62952, 11.0844<,87.52997, 12.234<, 88.64431, 11.7231<, 87.51426, 12.2147<, 85.51932, 12.5933<<
alternativ
punkte = Import@".�17.18.10.P2.punkte.csv"D8810.1291, 10.7094<, 87.39324, 12.2047<, 811.7789, 8.37764<,
810.7244, 9.94977<, 85.60441, 12.6615<, 810.1236, 10.7326<,88.78503, 11.7883<, 86.99274, 12.2728<, 85.81048, 12.5204<, 812.0992, 8.01506<,85.56326, 12.7078<, 89.98997, 10.6254<, 89.4529, 11.2909<, 89.66751, 10.929<,88.17312, 11.9233<, 88.65314, 11.6441<, 87.39466, 12.1831<, 86.86538, 12.4858<,87.31823, 12.2729<, 810.3271, 10.446<, 811.3332, 9.32653<, 89.05241, 11.5063<,811.8809, 8.4599<, 86.58427, 12.5158<, 812.3069, 7.0755<, 89.62952, 11.0844<,87.52997, 12.234<, 88.64431, 11.7231<, 87.51426, 12.2147<, 85.51932, 12.5933<<
alternativ:
punktetab = Import@".�17.18.10.P2.punkte.tab"D8810.1291, 10.7094<, 87.39324, 12.2047<, 811.7789, 8.37764<,
810.7244, 9.94977<, 85.60441, 12.6615<, 810.1236, 10.7326<,88.78503, 11.7883<, 86.99274, 12.2728<, 85.81048, 12.5204<, 812.0992, 8.01506<,85.56326, 12.7078<, 89.98997, 10.6254<, 89.4529, 11.2909<, 89.66751, 10.929<,88.17312, 11.9233<, 88.65314, 11.6441<, 87.39466, 12.1831<, 86.86538, 12.4858<,87.31823, 12.2729<, 810.3271, 10.446<, 811.3332, 9.32653<, 89.05241, 11.5063<,811.8809, 8.4599<, 86.58427, 12.5158<, 812.3069, 7.0755<, 89.62952, 11.0844<,87.52997, 12.234<, 88.64431, 11.7231<, 87.51426, 12.2147<, 85.51932, 12.5933<<
option = 8PlotStyle ® Directive@[email protected], RedD,Background ® White,
Axes ® False,
Frame ® True,
PlotRange ® Automatic,
AspectRatio ® Automatic<;
ListPlot@punkte, optionD
6 7 8 9 10 11 12
7
8
9
10
11
12
Zu rekonstruieren: Kreismittelpunkt {5.1,5.1} und Radius 7.5.
Gerade zu einem Punktepaar
f@setoftwopoints_D := Module@8x1, x2, drehMatrix, mittelPunkt, richtungsVektor<,8x1, x2< = setoftwopoints;
mittelPunkt = Hx1 + x2L � 2;drehMatrix = 880, -1<, 81, 0<<;richtungsVektor = drehMatrix.Hx2 - x1L � [email protected] - x1LD;8mittelPunkt, richtungsVektor<
D
Visierlinien
gezogene Punktepaare
n = 25
25
2 17.18.10.P2.solution.nb
randomPunktePaare = RandomChoice@punkte, 8n, 2<D;
gutePunktePaare = Select@randomPunktePaare, Norm@ð@@1DD - ð@@2DDD > 2 &D;
xvPaare = Map@f, gutePunktePaareD;
Punkte und Richtungen
richtungsVektoren = Part@xvPaare, All, 2D;
mittelPunkte = Part@xvPaare, All, 1D;
kleinste Quadrate, linke Seite
m@i_D :=
IdentityMatrix@2D - Transpose@8richtungsVektoren@@iDD<D.8richtungsVektoren@@iDD<
systemMatrix = Fold@Join, m@1D, Table@m@iD, 8i, 2, Length@gutePunktePaareD<DD;
kleinste Quadrate, rechte Seite
rechteSeite = Fold@Join, [email protected]@@1DD,Table@mittelPunkte@@iDD, 8i, 2, Length@gutePunktePaareD<DD;
Lösung
mittelpunkt = [email protected], 5.18421<
Mean�Map@Norm@mittelpunkt - ðD &, punkteD7.42229
17.18.10.P2.solution.nb 3