![三角形的一条线与通过对顶点和外心的另一条线的交点](https://linux22.com/image/472673/%E4%B8%89%E8%A7%92%E5%BD%A2%E7%9A%84%E4%B8%80%E6%9D%A1%E7%BA%BF%E4%B8%8E%E9%80%9A%E8%BF%87%E5%AF%B9%E9%A1%B6%E7%82%B9%E5%92%8C%E5%A4%96%E5%BF%83%E7%9A%84%E5%8F%A6%E4%B8%80%E6%9D%A1%E7%BA%BF%E7%9A%84%E4%BA%A4%E7%82%B9.png)
我有以下代码:
pair a; pair b; pair c;
pickup pencircle scaled 0.2pt;
a = (0, 4cm); b = (-2cm, 0); c = (1cm, 0);
draw a -- b -- c -- cycle;
pair p; pair q; pair r; pair d; pair m; pair n;
p = whatever[b, c]; a - p = whatever * (b - c) rotated 90;
q = whatever[c, a]; b - q = whatever * (c - a) rotated 90;
r = whatever[a, b]; c - r = whatever * (a -b) rotated 90;
d = whatever[a, p] = whatever[b, q]; % orthocenter
n = 1/4(a + b + c + d); % remarkably...
m = d rotatedabout(n, 180); % M is also the circumcentre
path circumcircle;
circumcircle = fullcircle scaled 2 abs(m - a) shifted m;
draw circumcircle;
pair l;
pickup pencircle scaled 2pt;
drawdot m;
pickup pencircle scaled 0.2pt;
%draw a -- ((a -- m) intersectionpoint (b -- c));
我可以计算外心,而且它有效。但是,当取消注释时,最后一行注释告诉我路径不相交。是否AM
没有扩展用于与 BC 相交计算的情况?我想我可以用shifted
关键字来管理它,但不知道如何做。任何帮助都将不胜感激。
答案1
我设法将最后一行更改为以下内容:
draw a -- (a -- (a - 100(a - m))) intersectionpoint (b -- c);
并接通线路。看来线路需要延长才能intersectionpoint
工作。
答案2
如果你想遵循与之前代码相同的风格,你也可以这样做
pair q ; q = whatever[a,m] = whatever[b,c] ;
draw a -- q ;