Clear["Global`*"];
(OverBar[b])=b=0;  (OverBar[c])=c=1;a=(((u^2) ((v^2)-1))/((u^2) (v^2)-1)); (OverBar[a])=(((v^2)-1)/((u^2) (v^2)-1)); o=(((u^2) (v^2))/((u^2) (v^2)-1));(OverBar[o])=(1/(1-(u^2) (v^2)));R=(( I u v)/((u^2) (v^2)-1));
 i=((u (v-1))/(u v-1)); (OverBar[i])=((v-1)/(u v-1));  m=((u v)/(u v-1));  (OverBar[m])=(1/(1-u v));  (*上述公式是利用该构图条件下的已知公式*)
Duichengdian[p_,a_, k_] :=-k (OverBar[a])+k (OverBar[p])+a;   (* P 点关于直线的镜像, 直线过已知点A且复斜率为 k *)
(OverBar[Duichengdian])[p_,a_, k_] := (k (OverBar[a])-a+p)/k;
z=Simplify@Duichengdian[a,o,-((a-o)/((OverBar[a])-(OverBar[o])))]; (OverBar[z])=Simplify@(OverBar[Duichengdian])[a,o,-((a-o)/((OverBar[a])-(OverBar[o])))];(*Z点是O点的镜像，镜线是通过O点并与AO垂直的直线*)
Print["z = ",z];
Jd[k1_, a1_, k2_, a2_] := -((k2 (a1 - k1(OverBar[a1])) - k1 (a2 - k2(OverBar[a2])))/(k1 - k2));
(OverBar[Jd])[k1_, a1_, k2_, a2_] := -((a1 - k1(OverBar[a1]) - (a2 - k2(OverBar[a2])))/(k1 - k2));
(*复斜率等于k1且经过A1点的直线，与复斜率等于k2且经过A2点的直线，两直线的交点*)
j=Simplify@Jd[((a-i)/((OverBar[a])-(OverBar[i]))), a,-((c-i)/((OverBar[c])-(OverBar[i]))), c]; (OverBar[j])=Simplify@(OverBar[Jd])[((a-i)/((OverBar[a])-(OverBar[i]))), a,-((c-i)/((OverBar[c])-(OverBar[i]))), c];(* 旁心 J 是两直线的交点，一条是通过A点、复斜率为kAI的直线，一条是通过C点、复斜率为 -kCI 的直线。*)
Print["j = ",j];
IM=Simplify[Abs[(i-m)]]; JM=Simplify[Abs[(m-j)]];
Print["IM = ",IM]; Print["JM = ",JM];
Print["由于 IM = JM，所以 IJ 的垂直平分线通过 M 点。 "]
k=Simplify@Jd[-((a-m)/((OverBar[a])-(OverBar[m]))), m,1, b]; (OverBar[k])=Simplify@(OverBar[Jd])[-((a-m)/((OverBar[a])-(OverBar[m]))), m,1, b];(*K是两直线的交点，一条是通过B点、复斜率为 1 的水平线，一条是通过M点、复斜率为 -kAM 的直线。*)
y=Simplify@Jd[-((j-z)/((OverBar[j])-(OverBar[z]))), a,((j-z)/((OverBar[j])-(OverBar[z]))), z]; (OverBar[y])=Simplify@(OverBar[Jd])[-((j-z)/((OverBar[j])-(OverBar[z]))), a,((j-z)/((OverBar[j])-(OverBar[z]))), z];
(*Y是两直线的交点，一条是通过A点、复斜率为 -kJZ 的直线，一条是通过Z点、复斜率为 kJZ 的直线。*)
Print["k = ",k]; Print["y = ",y]; 
FourPoint[a_, b_, c_, d_] := (((OverBar[c]) d - c(OverBar[d])) (a - b) - ((OverBar[a]) b - a(OverBar[b])) (c - d))/((a - b) ((OverBar[c]) -(OverBar[d])) - ((OverBar[a]) -(OverBar[b])) (c - d));
(OverBar[FourPoint])[a_, b_, c_, d_] := -(((c(OverBar[d]) -(OverBar[c]) d) ((OverBar[a]) -(OverBar[b])) - ( a(OverBar[b]) -(OverBar[a]) b) ((OverBar[c]) -(OverBar[d])))/((a - b) ((OverBar[c]) -(OverBar[d])) - ((OverBar[a]) -(OverBar[b])) (c - d)));
(*直线 AB 与 CD 的交点复坐标*)
AI2=Simplify[(a-i) ((OverBar[a])-(OverBar[i]))];(*AI长度的平方*) o1=Simplify[((a+i)/2)];(OverBar[ o1])=Simplify[(((OverBar[a])+(OverBar[i]))/2)];(*AI的中点*)
Print["o1 = ",o1];
WW=Simplify@Solve[{(x-o1) ((OverBar[x])-(OverBar[o1]))==(1/4)AI2,(x-o) ((OverBar[x])-(OverBar[o]))==(R^2),x≠a},{x,(OverBar[x])}]//Flatten;(*o1圆与o圆的交点X*)
x=Part[Part[WW,1],2];  (OverBar[x])=Part[Part[WW,2],2];
Print["x = ",x];
n=Simplify@FourPoint[a,k,x,y]; (OverBar[n])=Simplify@(OverBar[FourPoint])[a,k,x,y]; (*直线AK与直线XY的交点N*)
Print["n = ",n];
YN=Simplify[Abs[(y-n)]];(*YN线段的长度*)   XN=Simplify[Abs[(x-n)]];(*XN线段的长度*)
Print["YN = ",YN]; Print["XN = ",XN];
Print["由于 YN = XN，所以 AK 平分 XY。 "];