Difference between revisions of "AoPSWiki:Sandbox"
Aquadragon (talk | contribs) |
Aquadragon (talk | contribs) |
||
Line 30: | Line 30: | ||
'''#2 Setting points''' | '''#2 Setting points''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
To create points in your diagram you can use | To create points in your diagram you can use | ||
<code>A = (0,0);</code> | <code>A = (0,0);</code> | ||
Line 37: | Line 38: | ||
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. | 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. | ||
− | </div></div> | + | </blockquote></div></div> |
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#3 Pair part 1''' | '''#3 Pair part 1''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
If you include variables in your diagram you have to have <math>\verb#pair#</math> somewhere in your code. | If you include variables in your diagram you have to have <math>\verb#pair#</math> somewhere in your code. | ||
Example: You have two points <math>A</math> and <math>B</math>, and you're drawing a line connecting them, you need to include | Example: You have two points <math>A</math> and <math>B</math>, and you're drawing a line connecting them, you need to include | ||
− | + | pair A,B; | |
− | |||
− | |||
in your diagram to make it work. | in your diagram to make it work. | ||
− | </div></div> | + | </blockquote></div></div> |
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#4 Connecting two points, coloring the line''' | '''#4 Connecting two points, coloring the line''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
Once you have set variables <math>A</math> and <math>B</math>, you can connect them by writing | Once you have set variables <math>A</math> and <math>B</math>, you can connect them by writing | ||
Line 103: | Line 104: | ||
draw(A--B--cycle, dashed+red); | draw(A--B--cycle, dashed+red); | ||
</asy> | </asy> | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#5 Labeling, Midpoint''' | '''#5 Labeling, Midpoint''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
To label a point you can use | To label a point you can use | ||
Line 145: | Line 148: | ||
label("$x$", midpoint(A--B), NE); | label("$x$", midpoint(A--B), NE); | ||
</asy> | </asy> | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#6 Angle Measures''' | '''#6 Angle Measures''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
If you want to draw an angle measure on an angle use | If you want to draw an angle measure on an angle use | ||
Line 195: | Line 200: | ||
label(scale(.75)*"$90^\circ$", B, 2.5*dir(50)); | label(scale(.75)*"$90^\circ$", B, 2.5*dir(50)); | ||
</asy> | </asy> | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
''' #7 Distance Function''' | ''' #7 Distance Function''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: fath2012) | (Source: fath2012) | ||
''' My distance function''' | ''' My distance function''' | ||
Line 209: | Line 216: | ||
''' A note ''' | ''' A note ''' | ||
Apparently a pair has an x property and a y property. I kind of discovered this it by testing. I think it might be documented somewhere. | Apparently a pair has an x property and a y property. I kind of discovered this it by testing. I think it might be documented somewhere. | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#8 Casting''' | '''#8 Casting''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: fath2012) | (Source: fath2012) | ||
''' Casting ''' | ''' Casting ''' | ||
Line 230: | Line 239: | ||
label((string) b,a,S); | label((string) b,a,S); | ||
</code> | </code> | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#9 Right Angle Mark''' | '''#9 Right Angle Mark''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
If you want to draw a right angle mark use this: | If you want to draw a right angle mark use this: | ||
Line 254: | Line 265: | ||
draw(rightanglemark(A,B,C,1.5)); | draw(rightanglemark(A,B,C,1.5)); | ||
</asy> | </asy> | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#10 Intersection''' | '''#10 Intersection''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
If you want to draw a point on an intersection of two lines you can use: | If you want to draw a point on an intersection of two lines you can use: | ||
Line 281: | Line 294: | ||
F = intersectionpoint(A -- B, C -- D); | F = intersectionpoint(A -- B, C -- D); | ||
</asy> | </asy> | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#11 Filling''' | '''#11 Filling''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
To show you how to fill in a part of a diagram with a color I'll use an example from Week 3 Problem 5 in AoPS's Introduction to Geometry course. | To show you how to fill in a part of a diagram with a color I'll use an example from Week 3 Problem 5 in AoPS's Introduction to Geometry course. | ||
Line 373: | Line 388: | ||
Try out different colors to see which ones you prefer for your asymptote diagrams. | Try out different colors to see which ones you prefer for your asymptote diagrams. | ||
Have fun! | Have fun! | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#12 Dot''' | '''#12 Dot''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
If you want to draw a dot on a point on your diagram use | If you want to draw a dot on a point on your diagram use | ||
Line 395: | Line 413: | ||
<code>dot(A);</code> | <code>dot(A);</code> | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#13 Size''' | '''#13 Size''' |
Revision as of 11:49, 2 June 2022
Asymptote tutorial for AoPS
The Name Asymptote
Tips
#1 Beginning your code
#2 Setting points
#3 Pair part 1
#4 Connecting two points, coloring the line
#5 Labeling, Midpoint
#6 Angle Measures
#7 Distance Function
#8 Casting
#9 Right Angle Mark
#10 Intersection
#11 Filling
#12 Dot
#13 Size
#14 Tick Marks
#15 Arrows
#16 Shifting Coordinates
#17 Rotating
#18 Circles
#19 Dashed Lines
#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