gtsam/doc/Mathematica/SimiliarityGroup.nb

414 lines
15 KiB
Mathematica

(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 10.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 15602, 404]
NotebookOptionsPosition[ 14491, 364]
NotebookOutlinePosition[ 14850, 380]
CellTagsIndexPosition[ 14807, 377]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell[TextData[{
"Similarity Group\n",
StyleBox["Representation\n", "Chapter"],
StyleBox["A similarity transformation is a combination ", "Text"],
"\n",
StyleBox["Exponential and Logmap\n\nRetract and localCoordinate", "Chapter"]
}], "Title",
CellChangeTimes->{{3.6442457705813923`*^9, 3.644245851964954*^9}, {
3.644245883900199*^9, 3.644245897451631*^9}, {3.644246409411936*^9,
3.6442464411218433`*^9}, {3.644246632965823*^9, 3.644246721355283*^9},
3.644339337635804*^9, {3.6443397539003696`*^9, 3.644339805690949*^9}, {
3.6443398507824793`*^9, 3.644339940436355*^9}, {3.644339982058689*^9,
3.64434014492003*^9}, {3.644340183085711*^9, 3.64434030003795*^9}, {
3.644340442268632*^9, 3.644340457502075*^9}, {3.644340502643257*^9,
3.644340517682786*^9}, {3.644340590324332*^9, 3.644340590748303*^9}}],
Cell[BoxData[
RowBox[{"\[IndentingNewLine]",
RowBox[{
Cell["Lie group generators for similarity transform:"],
"\[IndentingNewLine]",
RowBox[{"G1", " ", "=", " ",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "1"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}]}], "}"}]}],
"\[IndentingNewLine]",
RowBox[{"G2", " ", "=", " ",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "1"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}]}], "}"}]}],
"\[IndentingNewLine]",
RowBox[{"G3", " ", "=", " ",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "1"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}]}], "}"}]}],
"\[IndentingNewLine]",
RowBox[{"G4", " ", "=", " ",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",",
RowBox[{"-", "1"}], ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "1", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}]}], "}"}]}],
"\[IndentingNewLine]",
RowBox[{"G5", " ", "=", " ",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "1", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}]}], "}"}]}],
"\[IndentingNewLine]",
RowBox[{"G6", " ", "=", " ",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",",
RowBox[{"-", "1"}], ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "1"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}]}], "}"}]}],
"\[IndentingNewLine]",
RowBox[{"G7", " ", "=", " ",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",",
RowBox[{"-", "1"}]}], "}"}]}], "}"}]}]}]}]], "Input",
CellChangeTimes->{{3.644340621916498*^9, 3.644340623238144*^9}, {
3.64434081043055*^9, 3.644340996367342*^9}, {3.6443410615657*^9,
3.644341237564106*^9}, {3.644341297291617*^9, 3.6443413676185513`*^9}, {
3.644341671605256*^9, 3.64434167330084*^9}}],
Cell[CellGroupData[{
Cell[BoxData[{Cell["Lie vectors similarity3 can be described as:"], "\
\[IndentingNewLine]",
RowBox[{"u", " ", "=", " ",
RowBox[{"{",
RowBox[{"x", ",", "y", ",", "z"}], "}"}]}], "\[IndentingNewLine]",
RowBox[{"v", " ", "=", " ",
RowBox[{"{",
RowBox[{"w1", ",", "w2", ",", "w3"}], "}"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"simLieVector", " ", "=", " ",
RowBox[{"{",
RowBox[{"u", ",", "v", ",", "lambda"}], "}"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]", Cell["The matrix form of \
the similarity vector is:"], "\[IndentingNewLine]",
RowBox[{"simMatrix", " ", "=", " ",
RowBox[{"Table", "[",
RowBox[{"0", ",",
RowBox[{"{",
RowBox[{"i", ",", "4"}], "}"}], ",",
RowBox[{"{",
RowBox[{"j", ",", "4"}], "}"}]}], "]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"simMatrix", "[",
RowBox[{"[",
RowBox[{
RowBox[{"1", ";;", "3"}], ",",
RowBox[{"1", ";;", "3"}]}], "]"}], "]"}], " ", "=", " ",
RowBox[{"SkewSym", "[", "v", "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]", Cell["\<\
The exponential map of similarity3 is:
\
\>"]}], "Input",
CellChangeTimes->{{3.64434137002735*^9, 3.644341539824277*^9}, {
3.644341595117811*^9, 3.644341750502033*^9}, {3.6443418211779013`*^9,
3.644341871033806*^9}, {3.644341902145*^9, 3.6443419325955687`*^9}, {
3.6443420032518187`*^9, 3.644342080926795*^9}, {3.644344115577599*^9,
3.644344138921712*^9}, {3.644344183657415*^9, 3.644344243563266*^9}, {
3.644344277871182*^9, 3.6443442927775*^9}, {3.6443443719167137`*^9,
3.6443445055251913`*^9}, {3.6443445402223988`*^9, 3.644344621076252*^9}, {
3.644344658699892*^9, 3.644344696943632*^9}, {3.644344750998406*^9,
3.644344755470311*^9}, {3.6443451156161633`*^9, 3.644345149594688*^9}}],
Cell[BoxData[
InterpretationBox[Cell["Lie vectors similarity3 can be described as:"],
TextCell["Lie vectors similarity3 can be described as:"]]], "Output",
CellChangeTimes->{{3.6443419121329803`*^9, 3.644341920689967*^9},
3.644342083088463*^9, {3.644344124265246*^9, 3.6443441324042997`*^9}, {
3.6443441881168823`*^9, 3.6443441950748997`*^9}, {3.644344229943321*^9,
3.644344245111559*^9}, {3.644344284483355*^9, 3.6443442933267717`*^9},
3.6443444220909557`*^9, {3.6443444591254807`*^9, 3.6443445061756277`*^9}, {
3.6443445415799227`*^9, 3.64434458046883*^9}, 3.644344622442521*^9, {
3.644344676089139*^9, 3.644344697634576*^9}, {3.644345119918116*^9,
3.644345130310161*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{"x", ",", "y", ",", "z"}], "}"}]], "Output",
CellChangeTimes->{{3.6443419121329803`*^9, 3.644341920689967*^9},
3.644342083088463*^9, {3.644344124265246*^9, 3.6443441324042997`*^9}, {
3.6443441881168823`*^9, 3.6443441950748997`*^9}, {3.644344229943321*^9,
3.644344245111559*^9}, {3.644344284483355*^9, 3.6443442933267717`*^9},
3.6443444220909557`*^9, {3.6443444591254807`*^9, 3.6443445061756277`*^9}, {
3.6443445415799227`*^9, 3.64434458046883*^9}, 3.644344622442521*^9, {
3.644344676089139*^9, 3.644344697634576*^9}, {3.644345119918116*^9,
3.64434513031706*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{"w1", ",", "w2", ",", "w3"}], "}"}]], "Output",
CellChangeTimes->{{3.6443419121329803`*^9, 3.644341920689967*^9},
3.644342083088463*^9, {3.644344124265246*^9, 3.6443441324042997`*^9}, {
3.6443441881168823`*^9, 3.6443441950748997`*^9}, {3.644344229943321*^9,
3.644344245111559*^9}, {3.644344284483355*^9, 3.6443442933267717`*^9},
3.6443444220909557`*^9, {3.6443444591254807`*^9, 3.6443445061756277`*^9}, {
3.6443445415799227`*^9, 3.64434458046883*^9}, 3.644344622442521*^9, {
3.644344676089139*^9, 3.644344697634576*^9}, {3.644345119918116*^9,
3.644345130321727*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"x", ",", "y", ",", "z"}], "}"}], ",",
RowBox[{"{",
RowBox[{"w1", ",", "w2", ",", "w3"}], "}"}], ",", "lambda"}],
"}"}]], "Output",
CellChangeTimes->{{3.6443419121329803`*^9, 3.644341920689967*^9},
3.644342083088463*^9, {3.644344124265246*^9, 3.6443441324042997`*^9}, {
3.6443441881168823`*^9, 3.6443441950748997`*^9}, {3.644344229943321*^9,
3.644344245111559*^9}, {3.644344284483355*^9, 3.6443442933267717`*^9},
3.6443444220909557`*^9, {3.6443444591254807`*^9, 3.6443445061756277`*^9}, {
3.6443445415799227`*^9, 3.64434458046883*^9}, 3.644344622442521*^9, {
3.644344676089139*^9, 3.644344697634576*^9}, {3.644345119918116*^9,
3.644345130326034*^9}}],
Cell[BoxData[
InterpretationBox[Cell["The matrix form of the similarity vector is:"],
TextCell["The matrix form of the similarity vector is:"]]], "Output",
CellChangeTimes->{{3.6443419121329803`*^9, 3.644341920689967*^9},
3.644342083088463*^9, {3.644344124265246*^9, 3.6443441324042997`*^9}, {
3.6443441881168823`*^9, 3.6443441950748997`*^9}, {3.644344229943321*^9,
3.644344245111559*^9}, {3.644344284483355*^9, 3.6443442933267717`*^9},
3.6443444220909557`*^9, {3.6443444591254807`*^9, 3.6443445061756277`*^9}, {
3.6443445415799227`*^9, 3.64434458046883*^9}, 3.644344622442521*^9, {
3.644344676089139*^9, 3.644344697634576*^9}, {3.644345119918116*^9,
3.64434513033029*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}]}], "}"}]], "Output",
CellChangeTimes->{{3.6443419121329803`*^9, 3.644341920689967*^9},
3.644342083088463*^9, {3.644344124265246*^9, 3.6443441324042997`*^9}, {
3.6443441881168823`*^9, 3.6443441950748997`*^9}, {3.644344229943321*^9,
3.644344245111559*^9}, {3.644344284483355*^9, 3.6443442933267717`*^9},
3.6443444220909557`*^9, {3.6443444591254807`*^9, 3.6443445061756277`*^9}, {
3.6443445415799227`*^9, 3.64434458046883*^9}, 3.644344622442521*^9, {
3.644344676089139*^9, 3.644344697634576*^9}, {3.644345119918116*^9,
3.644345130334682*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",",
RowBox[{"-", "w3"}], ",", "w2"}], "}"}], ",",
RowBox[{"{",
RowBox[{"w3", ",", "0", ",",
RowBox[{"-", "w1"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"-", "w2"}], ",", "w1", ",", "0"}], "}"}]}], "}"}]], "Output",
CellChangeTimes->{{3.6443419121329803`*^9, 3.644341920689967*^9},
3.644342083088463*^9, {3.644344124265246*^9, 3.6443441324042997`*^9}, {
3.6443441881168823`*^9, 3.6443441950748997`*^9}, {3.644344229943321*^9,
3.644344245111559*^9}, {3.644344284483355*^9, 3.6443442933267717`*^9},
3.6443444220909557`*^9, {3.6443444591254807`*^9, 3.6443445061756277`*^9}, {
3.6443445415799227`*^9, 3.64434458046883*^9}, 3.644344622442521*^9, {
3.644344676089139*^9, 3.644344697634576*^9}, {3.644345119918116*^9,
3.644345130339306*^9}}],
Cell[BoxData[
InterpretationBox[Cell["\<\
The exponential map of similarity3 is:
\
\>"],
TextCell["The exponential map of similarity3 is:\n"]]], "Output",
CellChangeTimes->{{3.6443419121329803`*^9, 3.644341920689967*^9},
3.644342083088463*^9, {3.644344124265246*^9, 3.6443441324042997`*^9}, {
3.6443441881168823`*^9, 3.6443441950748997`*^9}, {3.644344229943321*^9,
3.644344245111559*^9}, {3.644344284483355*^9, 3.6443442933267717`*^9},
3.6443444220909557`*^9, {3.6443444591254807`*^9, 3.6443445061756277`*^9}, {
3.6443445415799227`*^9, 3.64434458046883*^9}, 3.644344622442521*^9, {
3.644344676089139*^9, 3.644344697634576*^9}, {3.644345119918116*^9,
3.644345130343567*^9}}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{"simExponetialMap", " ", "=", " ",
RowBox[{"Expand", "[",
RowBox[{"Series", "[", "]"}], "]"}]}], "\[IndentingNewLine]"}]], "Input",
CellChangeTimes->{{3.644341752983704*^9, 3.644341812107615*^9}}],
Cell[BoxData[
InterpretationBox[Cell["Lie vectors:"],
TextCell["Lie vectors:"]]], "Output",
CellChangeTimes->{3.644341528720538*^9, 3.64434162193827*^9}],
Cell[BoxData[
RowBox[{"{",
RowBox[{"x", ",", "y", ",", "z"}], "}"}]], "Output",
CellChangeTimes->{3.644341528720538*^9, 3.644341621943945*^9}],
Cell[BoxData[
RowBox[{"{",
RowBox[{"w1", ",", "w2", ",", "w3"}], "}"}]], "Output",
CellChangeTimes->{3.644341528720538*^9, 3.644341621947913*^9}],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"x", ",", "y", ",", "z"}], "}"}], ",",
RowBox[{"{",
RowBox[{"w1", ",", "w2", ",", "w3"}], "}"}], ",", "lambda"}],
"}"}]], "Output",
CellChangeTimes->{3.644341528720538*^9, 3.644341621951668*^9}],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",",
RowBox[{"-", "w3"}], ",", "w2"}], "}"}], ",",
RowBox[{"{",
RowBox[{"w3", ",", "0", ",",
RowBox[{"-", "w1"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"-", "w2"}], ",", "w1", ",", "0"}], "}"}]}], "}"}]], "Output",
CellChangeTimes->{3.644341528720538*^9, 3.644341621955081*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"I3", " ", "=", " ",
RowBox[{"IdentyMatrix", "[", "3", "]"}]}]], "Input",
CellChangeTimes->{{3.6443405921748047`*^9, 3.6443406096153393`*^9}}],
Cell[BoxData[
RowBox[{"IdentyMatrix", "[", "3", "]"}]], "Output",
CellChangeTimes->{3.64434061119941*^9}]
}, Open ]]
}, Open ]]
},
WindowSize->{808, 579},
WindowMargins->{{Automatic, -111}, {Automatic, 20}},
FrontEndVersion->"10.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (December 4, \
2014)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 828, 14, 287, "Title"],
Cell[1411, 38, 3548, 95, 166, "Input"],
Cell[CellGroupData[{
Cell[4984, 137, 1814, 41, 206, "Input"],
Cell[6801, 180, 703, 10, 31, "Output"],
Cell[7507, 192, 627, 10, 28, "Output"],
Cell[8137, 204, 631, 10, 28, "Output"],
Cell[8771, 216, 757, 15, 28, "Output"],
Cell[9531, 233, 702, 10, 31, "Output"],
Cell[10236, 245, 914, 18, 28, "Output"],
Cell[11153, 265, 874, 19, 28, "Output"],
Cell[12030, 286, 702, 13, 49, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[12769, 304, 240, 5, 46, "Input"],
Cell[13012, 311, 157, 3, 31, "Output"],
Cell[13172, 316, 147, 3, 28, "Output"],
Cell[13322, 321, 150, 3, 28, "Output"],
Cell[13475, 326, 276, 8, 28, "Output"],
Cell[13754, 336, 393, 12, 28, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[14184, 353, 169, 3, 28, "Input"],
Cell[14356, 358, 107, 2, 28, "Output"]
}, Open ]]
}, Open ]]
}
]
*)
(* End of internal cache information *)