TXM2: Distance geometry between two points
1
. Note
TXM is the author’s initials, 2 is the author’s formula code
TXM is the author’s initials, 2 is the author’s formula code
2
.Caption
LetΔABCandP,Qaretwoarbitrarypoints.Thenwehave:=++Whereu=P+Q-P-Qv=P+Q-P-Qw=P+Q-P-QS=2areaΔABC,=Scotθ(Conwaytrianglenotation)
2
PQ
S
A
2
u
S
B
2
v
S
C
2
w
4
2
S
2
B
2
C
2
C
2
B
2
C
2
A
2
A
2
C
2
A
2
B
2
B
2
A
S
θ
3
.Code
In[]:=
ManipulateModule{a,b,c,SA,SB,SC,S,AA,BB,CC,P,Q,PQ,PA,PB,PC,QA,QB,QC,u,v,w},a=Sqrt[y^2+yz+z^2];b=Sqrt[z^2+zx+x^2];c=Sqrt[x^2+xy+y^2];SA=(b^2+c^2-a^2)2;SB=(c^2+a^2-b^2)2;SC=(a^2+b^2-c^2)2;S=Sqrt[SASB+SBSC+SCSA];AA={b,0};BB={SC/b,S/b};CC={0,0};P={m,n};Q={p,q};PQ=EuclideanDistance[P,Q];PA=EuclideanDistance[P,AA];PB=EuclideanDistance[P,BB];PC=EuclideanDistance[P,CC];QA=EuclideanDistance[Q,AA];QB=EuclideanDistance[Q,BB];QC=EuclideanDistance[Q,CC];u=N[+--];v=N[+--];w=N[+--];ColumnText@Grid+--","v=+--","w=+--",Style["",Red],Style"++",Red,],Red],Style,Red,Frame->All,FrameStyle->Hue[.6,.4,.8],Background->{None,{{None,GrayLevel[.9]}},{{1,1}->Hue[.6,.2,1],{1,2}->Hue[.6,.2,1],{1,3}->Hue[.6,.2,1],{1,4}->Hue[.6,.2,1],{1,5}->Hue[.6,.2,1],{1,6}->Hue[.6,.2,1]}},BaseStyle->{FontFamily->Times,FontSize->20},
2
PB
2
QC
2
PC
2
QB
2
PC
2
QA
2
PA
2
QC
2
PA
2
QB
2
PB
2
QA
"u=2
PB
2
QC
2
PC
2
QB
2
PC
2
QA
2
PA
2
QC
2
PA
2
QB
2
PB
2
QA
2
PQ
S
A
2
u
S
B
2
v
S
C
2
w
4
2
S
u,v,w,Style[N[2
PQ
SA+SB+SC
2
u
2
v
2
w
4
2
S
{
Graphics[{Style[Point/@{AA,BB,CC,P}],Text[Style["A",20,"Label"],AA+{0,.15}],Text[Style["B",20,"Label"],BB+{0,.15}],Text[Style["C",20,"Label"],CC+{0,.15}],Text[Style["P",20,"Label"],P+{0,.15}],Text[Style["Q",20,"Label"],Q+{0,.15}],Style[Line[{P,Q}],Red,Thickness[0.01`]],Style[{Line[{P,AA}],Line[{P,BB}],Line[{P,CC}],Line[{Q,AA}],Line[{Q,BB}],Line[{Q,CC}]},Gray,DotDashed,Thickness[0.01`]],Style[Triangle[{AA,BB,CC}],Opacity[.2`],RGBColor[x,y,z],EdgeForm[{Thickness[0.01`],Blue}]]},ImageSize{450,375}]},Alignment{Center,Top},Style["TXM2",30,FontFamily->"Times",Bold],Column[{Row[{Control@{{m,2,Style["m",15]},-5,5,1/6,Appearance->"Labeled"},Control@{{x,1,Style["x",15]},-5,5,1/6,Appearance->"Labeled"}}],Row[{Control@{{n,1,Style["n",15]},-5,5,1/6,Appearance->"Labeled"},Control@{{y,2,Style["y",15]},-5,5,1/6,Appearance->"Labeled"}}],Row[{Control@{{p,1,Style["p",15]},-5,5,1/6,Appearance->"Labeled"},Control@{{z,2/3,Style["z",15]},-5,5,1/6,Appearance->"Labeled"}}],Row[{Control@{{q,2,Style["q",15]},-5,5,1/6,Appearance->"Labeled"}}]}],SaveDefinitions->TrueOut[]=
5
.Author information

