使用 Asymptote 标记 3D 线段

使用 Asymptote 标记 3D 线段

线段 AM 和 BM 相等:是否可以在图中标记它们以表明这一点?

   import three;
   import math;
   usepackage("esvect");
   usepackage("mathrsfs");

  void drawrightangle(picture pic=currentpicture,
    triple M, triple A, triple B,
    real radius=0,
    pen p=currentpen,
    pen fillpen=nullpen,
    projection P=currentprojection)
    {
    p=linejoin(0)+linecap(0)+p;
    if (radius==0) radius=arrowfactor*sqrt(2);
    transform3 T=shift(-M);
    triple OA=radius/sqrt(2)*unit(T*A),
    OB=radius/sqrt(2)*unit(T*B),
    OC=OA+OB;
    path3 _p=OA--OC--OB;
    picture pic_;
    draw(pic_, _p, p=p);
    if (fillpen!=nullpen) draw(pic_, surface(O--_p--cycle), fillpen);
    add(pic,pic_,M);}

    triple pointABCD(triple A, triple B, triple C, triple D) {
    pair Xp = extension(project(A),project(B),project(C),project(D));
    return invert(Xp,A,B);
     }

   size(10cm);

   defaultpen(fontsize(10pt));
   pen style1 = linetype("4 4");

   currentprojection=obliqueX;


   triple s=(8,0,0),t=(0,10,0);
  
   path3 pl1=plane(s,t,O);

   triple A=(4,5,4);
   triple B=(4,5,-4);
   triple M=(1.5,7,0);

   transform3 proj=planeproject(pl1);

   triple I=proj*A;
   triple J=pointABCD(A,B,s,(8,10,0));
   triple K=pointABCD(M,B,s,(8,10,0));

   draw(surface(pl1),lightgray+opacity(.5),darkgray);
   draw(A--I^^J--B^^A--M^^I--M^^K--B);
   draw(I--J^^M--K,style1);
   drawrightangle(I,M,A,3mm,fillpen=red+opacity(0.5));
   label("$\mathscr{P}$",(7,0.5,0),E);
   dot("$A$",A,N);
   dot("$B$",B,S);
   dot("$I$",I,NW);
   dot("$M$",M,NE);

在此处输入图片描述

相关内容