2

I'm making some triangles in ConTeXt using Metafun's anglebetween macro. However, some angles look awful, specially if they're larger.

\starttext
\startuseMPgraphic{name} 
u := 4cm;
pair A, B, C, D, P;
path AB, BC, AC, BD, BP;
A = (0,0); C = (cosd 50 + cosd 80, 0)*u; B = (cosd 80, sind 80)*u;
P = (cosd 80, 0)*(u); D = P*2; 
AB = A -- B; AC = A -- C; BC = B -- C;
BD = B -- D; BP = B -- P; 
draw AB; draw BC; draw AC;
draw BD; draw BP;
draw anglebetween(A--B, A--C, "$8x$");
draw anglebetween(C--B, C--A, "$5x$");
draw anglebetween(B--D, B--A, "$2x$");
label.llft("{\tfx\ss A}", A);
label.urt("{\tfx\ss B}", B);
label.lrt("{\tfx\ss C}", C);
label.bot("{\tfx\ss P}", P);
label.bot("{\tfx\ss D}", D);
\stopuseMPgraphic
\useMPgraphic{name}
\stoptext

enter image description here

As readily seen, angles labelled 8x and 5x look too large. scaled gives weird results. How do I adjust angles so they have a smaller radius?

  • Is the anglelength parameter what you look for? Try set it to different values. – mickep Apr 12 '20 at 19:37
  • You could also just make your unit u bigger. Or better still make your own angle marks. – Thruston Apr 12 '20 at 19:39
2

Here's how you could do it using just the plain MP facilities. By "doing it yourself" you get the flexibility to adjust the arc sizes appropriately.

enter image description here

\starttext
\startuseMPgraphic{name}
    pair A, B, C, D, P;
    A = origin;
    B = 6cm * dir 80;
    ypart C = 0;
    B - C = whatever * dir 130;
    P = (xpart B, ypart A);
    D = A reflectedabout(P, B);

    path arc[];
    arc1 = fullcircle rotated angle (C-A) scaled 21 shifted A cutafter (A--B);
    arc2 = fullcircle rotated angle (B-C) scaled 32 shifted C cutafter (C--A);
    arc3 = fullcircle rotated angle (A-B) scaled 42 shifted B cutafter (B--D);

    drawoptions(withcolor 2/3 red);
    draw arc1; label.urt("$8x$", point 1 of arc1);
    draw arc2; label.ulft("$5x$", point 0.7 of arc2);
    draw arc3; label.lft("$2x$", point 0 of arc3);
    drawoptions();

    draw A -- B -- C -- cycle;
    draw P -- B -- D;

    label.llft("{\tfx\ss A}", A);
    label.top("{\tfx\ss B}", B);
    label.lrt("{\tfx\ss C}", C);
    label.bot("{\tfx\ss P}", P);
    label.bot("{\tfx\ss D}", D);
\stopuseMPgraphic
\useMPgraphic{name}
\stoptext
0

Just and only for fun.

Compile with Asymptote. :-)

unitsize(1cm);
pair A=(0,0),B=4.5*dir(80),C=(5.2,0),
     P=(B.x,A.y),D=reflect(P,B)*A;
draw(A--B--C--cycle^^B--P^^B--D);
draw(scale(.7)*Label("$2x$",Relative(0)),arc(B,0.4,degrees(dir(A-B)),degrees(dir(D-B))));
draw(scale(.7)*"$5x$",arc(C,0.3,degrees(dir(B-C)),degrees(dir(A-C))));
draw(scale(.7)*"$8x$",arc(A,0.3,0,80));
label("$A$",A,dir(-135));
label("$B$",B,dir(90));
label("$C$",C,dir(-45));
label("$P$",P,dir(-90));
label("$D$",D,dir(-90));

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy