三角形的一条线与通过对顶点和外心的另一条线的交点

三角形的一条线与通过对顶点和外心的另一条线的交点

我有以下代码:

      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 ;

相关内容