AoPSWiki:Sandbox

Revision as of 18:14, 3 June 2022 by Aquadragon (talk | contribs) (Why Asymptote is called Asymptote?)

Essential Reference for Using Asymptote in AoPS

A focused asymptote reference with examples and short code


Introduction


Why Asymptote is called Asymptote?

http://asymptote.sourceforge.net/FAQ/section1.html#whyasy

Question 1.4. Why was the name Asymptote chosen?

Well, it isn't the perfect graphics package, but we do think it is getting there asymptotically...

Tips

  • To see the asymptote code of any diagram made with asymptote, click on the diagram and it will come up.
  • If your code is not working check to make sure you have a semicolon after each line, no extra parentheses or brackets, and no open parentheses or brackets.
  • Another thing to check if your code is not working, is to make sure every variable you've used in your code is in the pair.


Beginning your code

To start your asymptote diagram you have to include [asy] at the beginning, and [/asy] at the ending.


Setting points

To create points in your diagram you can use

 A = (0,0);

Say you want to have point $B$ $4$ units to the right of point $A$, then you can use

 B = (4,0);

Setting points on your diagram is like setting points on a graph. The first number is the $x$-coordinate of the point and the second number is the $y$-coordinate of the point.

Note: You should not use E, S, N, or W as variables, instead you should use EE, SS, NN, and WW, but label them as E, S, N, W. This is because E, S, N, and W are used to indicate directions in asymptote.


Pair part 1

[asy] draw((0,0)--(3,7),red); dot((0,0)); dot((3,7)); label("Produced with Asymptote "+version.VERSION,point(S),2S); [/asy] [asy]..[/asy] [asy] draw((0,0)--(3,7),red); dot((0,0)); dot((3,7)); label("Produced with Asymptote "+version.VERSION,point(S),2S); [/asy]

If you include variables in your diagram you have to have $\verb#pair#$ somewhere in your code.

Example: You have two points $A$ and $B$, and you're drawing a line connecting them, you need to include pair A,B; in your diagram to make it work.


Expand

#4 Connecting two points, coloring the line

Expand

#5 Labeling, Midpoint

Expand

#6 Angle Measures

Expand

#7 Distance Function

Expand

#8 Casting

Expand

#9 Right Angle Mark

Expand

#10 Intersection

Expand

#11 Filling

Expand

#12 Dot

Expand

#13 Size

Expand

#14 Tick Marks

Expand

#15 Arrows

Expand

#16 Shifting Coordinates

Expand

#17 Rotating

Expand

#18 Circles

Expand

#19 Dashed Lines

Expand

#20 Angle Mark

Expand

#21 "for" Command

Expand

#22 Extension

Expand

#23 How to draw an equilateral triangle

Expand

#24 How to draw an isosceles triangle

Expand

#25 How to draw a scalene triangle

Expand

#26 Labeling Angles

Expand

#27 Drawing triangles using SSS, SAS, AAS, and ASA

Expand

#28 Arcs

Expand

#29 The Nine Point Circle

Expand

#30 Pair Part 2

Expand

#31 Finding the midpoint

Expand

#32 Foot Command

Expand

#33 Introduction to 3D Geometry