Professional Documents
Culture Documents
Tovi Wen
November 2020
There are plenty of good internet resources for helping someone get the basics of
asymptote down pact, after which they could theoretically figure out the tricky bits
for themself, but I’ll spell some of it out here.
§1 Introduction
Always import olympiad.asy from the external link here and begin your code with
import olympiad;
size(X cm);
defaultpen(fontsize(10pt));
Where X can be whatever you want (I usually choose something between 7 and 10) depending
on how detailed the diagram is.
§3 Circles
To mark the second intersection P of a line AD with the circumcircle of 4ABC (with D not
on the circle), write
pair O=circumcenter(A,B,C);
pair P = -A+2*foot(O,A,D);.
To mark the second intersection P of the circumcircles of 4ABC and 4AEF , write one of
pair P = intersectionpoints(circumcircle(A,B,C), circumcircle(A,E,F))[0];
pair P = intersectionpoints(circumcircle(A,B,C), circumcircle(A,E,F))[1];
.
1
Asymptote Cheat-Sheet Tovi Wen
As far as I know, there is no quick way to tell which intersection is correct, and which one is
useless and just duplicates A. Just compile both to find out which works.
To mark the two intersections P and Q, of the circumcircles of 4ABC and 4DEF , write
pair P = intersectionpoints(circumcircle(A,B,C), circumcircle(D,E,F))[0];
pair Q = intersectionpoints(circumcircle(A,B,C), circumcircle(D,E,F))[1];
.
§4 Drawing/Marking Things
If you want an arbitrary triangle (usually something that’s acute, and is especially not-special),
I usually write
pair A = dir(120);
pair B = dir(210);
pair C = dir(330);.
But you do you. The important thing is that dir(X) refers to the unit vector at an angle of
X degrees.
To draw the segment AB, and the circumcircle of 4ABC, write
draw(A--B);
draw(circumcircle(A,B,C));
To draw the triangle 4ABC without wasting too much time, write
draw(A--B--C--A);
and this technique works for general polygons as well.
To draw the arc of the circumcircle of 4ABC between 30 degrees above the horizontal and 190
degrees above the horizontal, write
draw(arc(circumcenter(A,B,C), circumradius(A,B,C), 30, 190));
To label the point A, write
dot(’’$A$’’, A, dir(X)); .
Where X is an angle that can be whatever you want. If A happens to lie on a circle centered
at the origin, it’s usually fine to just write
dot(’’$A$’’, A, dir(A));
But this doesn’t always work so well.
§5 Cosmetics
Skip this section if you want, but most people care about making their diagrams look classy
and pretty.
2
Asymptote Cheat-Sheet Tovi Wen
§6 Stuff I Forgot
This guide is by no means extensive. If there’s something you need to figure out that I haven’t
mentioned, just think of a problem that uses a similar construction (there probably is one),
and check the AOPS forum for that problem. Odds are somebody has made a nice asymptote
diagram that you can borrow some stuff from.
§7 Example
I think the following diagram involves most of the techniques discussed. If you’re interested,
the diagram is for GOTEEM 2019/5.
M
A B2
C2
R
B1
C1
B C
P
3
Asymptote Cheat-Sheet Tovi Wen
begin{center}
begin{asy}
import olympiad;
size(12 cm);
defaultpen(fontsize(10pt));
fill(circumcircle(A,B,C), blue+opacity(0.02));
fill(A--B--C--cycle, red+opacity(0.03));
draw(A--B--C--A, red);
draw(circumcircle(A,B,C), blue);
draw(circumcircle(A,B1,C1), springgreen+dashed);
draw(circumcircle(A,B,C1), orange + opacity(0.5));
draw(circumcircle(A,C,B1), orange + opacity(0.5));
draw(arc(M, circumradius(B1, C1, B2), 190, 365), dashed + heavycyan);
draw(arc(circumcenter(A,B2,C2), circumradius(A, B2, C2), 55, 145),
dotted + red);
draw(R--M, deepcyan);
draw(R--C1, deepcyan);
draw(R--C2, deepcyan);
draw(P--B2, lightblue);
draw(P--C2, lightblue);
draw(A--P, dotted + lightblue);
draw(B2--C1, dotted + lightblue);
draw(B2--C1, dotted + lightblue);
draw(C2--B1, dotted + lightblue);
dot(’’$A$’’, A, dir(A));
dot(’’$B$’’, B, dir(B));
dot(’’$C$’’, C, dir(C));
dot(’’$P$’’, P, dir(P));
dot(’’$B 1$’’, B1, dir(210));
dot(’’$C 1$’’, C1, dir(C1));
dot(’’$B 2$’’, B2, dir(B2));
dot(’’$C 2$’’, C2, dir(C2));
dot(’’$M$’’, M, dir(M));
dot(’’$R$’’, R, dir(R));
end{asy}
end{center}
4
Asymptote Cheat-Sheet Tovi Wen
§8 Exercises
Problem 1. Initialize the reflection of A over the line BC.
Problem 6. Make a nice asymptote diagram to be used in a solution to USA TSTST 2019/9.