In[]:=
JohnsonCircunconic::usage="Johnson's circunconic is a conical as its name suggests, which passes through the vertices of the base triangle and through the vertices of the Johnson triangle. Its center is the center of the circumference of the 9 points (). If all the angles are acute it is an ellipse, if there is an obtuse angle it is a hyperbola. References: Wolfram MathWorld: Johnson Circumconic, Johnson Triangle, Conway Triangle Notation; Personal. ";JohnsonCircunconic[tri={{x1_,y1_},{x2_,y2_},{x3_,y3_}},{X0_,X1_},{Y0_,Y1_}]:=Module{},DEP=Det[{{x1,y1,1},{x2,y2,1},{x3,y3,1}}];IfDEP==0||X0≥X1||Y0≥Y1,Print[PasteButton["Incorrect data or the points do not form a triangle"]],xm1=;ym1=;xm2=;ym2=;xm3=;ym3=;tri1={{xm1,ym1},{xm2,ym2},{xm3,ym3}};ρ=TriangleCenter[tri1,"Circumcenter"];xce=ρ[[1]];yce=ρ[[2]];aa=+;bb=+;cc1=+;α=ArcCos+-;β=ArcCos+-;γ=ArcCos+-;SA=bbcc1Cos[α];SB=aacc1Cos[β];SC=aabbCos[γ];s=;Δ=bbcc1SA;yy=bbcc1(+SASC);zz=bbcc1(+SASB);=;=;=;XJA={x1,y1}+{x2,y2}+{x3,y3};xXJA=N[Take[XJA,{1}].{1}];yXJA=N[Take[XJA,{2}].{1}];xx1=aacc1(+SBSC);yy1=-aacc1SB;zz1=aacc1(+SASB);=;=;=;XJB={x1,y1}+{x2,y2}+{x3,y3};xXJB=N[Take[XJB,{1}].{1}];yXJB=N[Take[XJB,{2}].{1}];xx2=aabb(+SBSC);yy2=aabb(+SASC);zz2=-aabbSC;=;=;=;XJC={x1,y1}+{x2,y2}+{x3,y3};xXJC=N[Take[XJC,{1}].{1}];yXJC=N[Take[XJC,{2}].{1}];p5={{x1,y1},{x2,y2},{x3,y3},{xXJA,yXJA},{xXJB,yXJB}};ξ=ResourceFunction["FivePointConic"][p5,{x,y}];g1=Line[{{x1,y1},{x2,y2},{x3,y3},{x1,y1}}];g2=ContourPlotξ==0,{x,X0,X1},{y,Y0,Y1},Epilog,Point[p5];g5=Point[{x1,y1}];g6=Point[{x2,y2}];g7=Point[{x3,y3}];g8=Point[{xce,yce}];g9=Line[{{xXJA,yXJA},{xXJB,yXJB},{xXJC,yXJC},{xXJA,yXJA}}];g10=Point[{xXJA,yXJA}];g11=Point[{xXJB,yXJB}];g12=Point[{xXJC,yXJC}];label[sym_,Point[pos_]]:={PointSize[Scaled[0.028]],Hue[0.58,1,1],Point[pos],Text[Style[sym,White,FontSizeScaled[0.015]],pos]};Print[PasteButton["Information about Johnson's circunconic:"]];Print[" "];δ=ResourceFunction["ConicProperties"][ξ==0,{x,y}];Print[δ];Show[{Graphics[{Blue,g1}],g2,Graphics[{Black,Thick,PointSize[0.01],g5}],Graphics[{Black,Thick,PointSize[0.01],g6}],Graphics[{Black,Thick,PointSize[0.01],g7}],Graphics[{MapThread[label,{{"","",},{g10,g11,g12}}]}],Graphics[{MapThread[label,{{""},{g8}}]}],Graphics[{Brown,g9}]},AxesTrue,AxesOrigin{0,0},AspectRatioAutomatic,ImageSize700,PlotLabelStyle[Framed["Johnson's Circunconic"],16,Blue,BackgroundYellow]]
X
5
x1+x2
2
y1+y2
2
x2+x3
2
y2+y3
2
x3+x1
2
y3+y1
2
2
(x3-x2)
2
(y3-y2)
2
(x3-x1)
2
(y3-y1)
2
(x2-x1)
2
(y2-y1)
2
bb
2
cc1
2
aa
2bbcc1
2
aa
2
cc1
2
bb
2aacc1
2
aa
2
bb
2
cc1
2aabb
aa+bb+cc1
2
s(s-aa)(s-bb)(s-cc1)
;S1=2Δ;xx=-2
aa
2
S1
2
S1
λ
1
xx
xx+yy+zz
λ
2
yy
xx+yy+zz
λ
3
zz
xx+yy+zz
λ
1
λ
2
λ
3
2
S1
2
bb
2
S1
λ
4
xx1
xx1+yy1+zz1
λ
5
yy1
xx1+yy1+zz1
λ
6
zz1
xx1+yy1+zz1
λ
4
λ
5
λ
6
2
S1
2
S1
2
cc1
λ
7
xx2
xx2+yy2+zz2
λ
8
yy2
xx2+yy2+zz2
λ
9
zz2
xx2+yy2+zz2
λ
7
λ
8
λ
9
J
A
J
B
J
C
X
5
In the command below, type the new coordinates of the points. You can also change the extension to X and Y. Evaluate the notebook.
In[]:=
JohnsonCircunconic[tri={{-2,5},{7,12},{9,-4}},{-20,20},{-20,20}]
TypeEllipse,Equation-6.20737-9.37858x+1.-4.1927y+0.337195xy+0.3114260,Foci{{1.73795,13.9941},{6.08484,-4.76629}},Vertices{{1.38118,15.5339},{6.4416,-6.30602}},Covertices{{-1.67938,3.31851},{9.50216,5.90934}},Eccentricity0.858999,Center{3.91139,4.61392},SemimajorAxisLength11.2092,SemiminorAxisLength5.73889,AreaEnclosed202.094,SemiLatusRectum2.93818,Directrices{y16.4378+0.231705x,y-7.58149+0.231705x},AxesOfSymmetry{y21.4948-4.31583x,y3.70763+0.231705x},Circumference54.6401,RotationAngle-1.34311,BaseConicEquation0.0079588+0.0303631,RotationAngle-1.34311,DisplacementFromOrigin{3.91139,4.61392}
2
x
2
y
2
x
2
y
Out[]=