Difference between revisions of "AoPSWiki:Sandbox"
Aquadragon (talk | contribs) |
Aquadragon (talk | contribs) |
||
Line 389: | Line 389: | ||
Have fun! | Have fun! | ||
</blockquote></div></div> | </blockquote></div></div> | ||
− | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
Line 414: | Line 413: | ||
<code>dot(A);</code> | <code>dot(A);</code> | ||
</blockquote></div></div> | </blockquote></div></div> | ||
− | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
Line 454: | Line 452: | ||
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%"> | ||
'''#14 Tick Marks''' | '''#14 Tick Marks''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
If you want to add tick marks to a line use | If you want to add tick marks to a line use | ||
Line 496: | Line 496: | ||
add(pathticks(A--B, 2, spacing=1, s=2)); | add(pathticks(A--B, 2, spacing=1, s=2)); | ||
</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%"> | ||
'''#15 Arrows''' | '''#15 Arrows''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
If you want to draw arrow marks to show that two lines are parallel you can use | If you want to draw arrow marks to show that two lines are parallel you can use | ||
Line 515: | Line 517: | ||
draw(A--C, MidArrow(size=0.2cm)); | draw(A--C, MidArrow(size=0.2cm)); | ||
</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%"> | ||
+ | |||
'''#16 Shifting Coordinates''' | '''#16 Shifting Coordinates''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: fath2012) | (Source: fath2012) | ||
You can use these to shift coordinates if you're shifting lots of coordinates | You can use these to shift coordinates if you're shifting lots of coordinates | ||
Line 528: | Line 532: | ||
return (p.x,p.y + amount); | return (p.x,p.y + amount); | ||
}</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%"> | ||
'''#17 Rotating''' | '''#17 Rotating''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: nosaj and Zhaom) | (Source: nosaj and Zhaom) | ||
Maybe if you really wanted to: rotate | Maybe if you really wanted to: rotate | ||
Line 538: | Line 544: | ||
</code> | </code> | ||
rotate B <math>x</math> degrees around center A is where C is. | rotate B <math>x</math> degrees around center A is where C is. | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#18 Circles''' | '''#18 Circles''' | ||
+ | <blockquote> | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
If you want to draw a circle use | If you want to draw a circle use | ||
Line 560: | Line 568: | ||
draw(Circle((0,0),0.4),p=green+1.5bp); | draw(Circle((0,0),0.4),p=green+1.5bp); | ||
</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%"> | ||
'''#19 Dashed Lines''' | '''#19 Dashed Lines''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: independentstudyproject) | (Source: independentstudyproject) | ||
If you want to draw a dashed line you can use | If you want to draw a dashed line you can use | ||
Line 583: | Line 593: | ||
dot(B); | dot(B); | ||
</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%"> | ||
'''#20 Angle Mark''' | '''#20 Angle Mark''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: Zhaom & mag1c) | (Source: Zhaom & mag1c) | ||
To make an actual angle mark: | To make an actual angle mark: | ||
Line 610: | Line 622: | ||
dot("A",A,SW*0.5); | dot("A",A,SW*0.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%"> | ||
'''#21 "for" Command''' | '''#21 "for" Command''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: Zhaom & heatherfinotti) | (Source: Zhaom & heatherfinotti) | ||
If you want to do the for thing you do | If you want to do the for thing you do | ||
Line 635: | Line 649: | ||
</asy></code> | </asy></code> | ||
[/hide] | [/hide] | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#22 Extension''' | '''#22 Extension''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
If you want to extend a line you can use this | If you want to extend a line you can use this | ||
Line 686: | Line 702: | ||
You have the extension <math>A, B,C,</math> and <math>I</math>, because you want it to go down from point <math>C</math>, through <math>I</math>, and end on <math>\overline{AB}</math>. | You have the extension <math>A, B,C,</math> and <math>I</math>, because you want it to go down from point <math>C</math>, through <math>I</math>, and end on <math>\overline{AB}</math>. | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#23 How to draw an equilateral triangle''' | '''#23 How to draw an equilateral triangle''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
In #23 we'll walkthrough how to make an equilateral triangle. | In #23 we'll walkthrough how to make an equilateral triangle. | ||
Line 754: | Line 772: | ||
</asy> | </asy> | ||
</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%"> | ||
'''#24 How to draw an isosceles triangle''' | '''#24 How to draw an isosceles triangle''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
In #24 we'll walkthrough how to make an isosceles triangle. | In #24 we'll walkthrough how to make an isosceles triangle. | ||
Let's start by placing <math>A</math> at <math>(0,0)</math>. | Let's start by placing <math>A</math> at <math>(0,0)</math>. | ||
Line 815: | Line 835: | ||
</asy> | </asy> | ||
</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%"> | ||
'''#25 How to draw a scalene triangle''' | '''#25 How to draw a scalene triangle''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
In #25 we'll walkthrough how to make a scalene triangle. | In #25 we'll walkthrough how to make a scalene triangle. | ||
Line 854: | Line 876: | ||
</asy> | </asy> | ||
</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%"> | ||
'''#26 Labeling Angles''' | '''#26 Labeling Angles''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: independentstudyproject) | (Source: independentstudyproject) | ||
This is similar to #6 but it labels the angle with the arc. | This is similar to #6 but it labels the angle with the arc. | ||
Line 873: | Line 897: | ||
label("$60^\circ$",(0.1,0.1),E); | label("$60^\circ$",(0.1,0.1),E); | ||
</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%"> | ||
'''#27 Drawing triangles using SSS, SAS, AAS, and ASA''' | '''#27 Drawing triangles using SSS, SAS, AAS, and ASA''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: Zhaom) | (Source: Zhaom) | ||
drawing triangles: | drawing triangles: | ||
Line 942: | Line 968: | ||
label("$C$",C,SE); | label("$C$",C,SE); | ||
</asy>[/hide],then <math>A</math>=[hide][c](0,0);[/c][/hide],<math>B</math>=[hide][c]dir(c)*b;[/c][/hide],and <math>C</math>=[hide][c](a,0);[/c][/hide]. | </asy>[/hide],then <math>A</math>=[hide][c](0,0);[/c][/hide],<math>B</math>=[hide][c]dir(c)*b;[/c][/hide],and <math>C</math>=[hide][c](a,0);[/c][/hide]. | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#28 Arcs''' | '''#28 Arcs''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: Zhaom and heatherfinotti) | (Source: Zhaom and heatherfinotti) | ||
If you want to draw an arc you can use | If you want to draw an arc you can use | ||
Line 969: | Line 997: | ||
</asy> | </asy> | ||
</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%"> | ||
'''#29 The Nine Point Circle''' | '''#29 The Nine Point Circle''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: Zhaom) | (Source: Zhaom) | ||
The nine point circle: | The nine point circle: | ||
Line 1,024: | Line 1,054: | ||
</asy>[/hide] | </asy>[/hide] | ||
The center is N and the radius is r/2. | The center is N and the radius is r/2. | ||
− | </div></div> | + | </blockquote></div></div> |
+ | |||
<div class="mw-collapsible mw-collapsed" style="width:100%"> | <div class="mw-collapsible mw-collapsed" style="width:100%"> | ||
'''#30 Pair Part 2''' | '''#30 Pair Part 2''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: Zhaom, eagle702) | (Source: Zhaom, eagle702) | ||
Another way to use the variables in the pair at the start of your code, is by using | Another way to use the variables in the pair at the start of your code, is by using | ||
Line 1,054: | Line 1,086: | ||
label("$B$", A[2], S); | label("$B$", A[2], 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%"> | ||
'''#31 Finding the midpoint''' | '''#31 Finding the midpoint''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
(Source: fath2012) | (Source: fath2012) | ||
This is really just a tool from the documetation but here it is anyway. | This is really just a tool from the documetation but here it is anyway. | ||
Line 1,073: | Line 1,107: | ||
dot(midpoint(A--B)); | dot(midpoint(A--B)); | ||
</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%"> | ||
'''#32 Foot Command''' | '''#32 Foot Command''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
If you want to draw a perpendicular line from a point to another line, you can use the foot command: | If you want to draw a perpendicular line from a point to another line, you can use the foot command: | ||
<code>draw(A--foot(A,B,C));</code> | <code>draw(A--foot(A,B,C));</code> | ||
Line 1,114: | Line 1,150: | ||
</asy> | </asy> | ||
</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%"> | ||
+ | |||
'''#33 Introduction to 3D Geometry''' | '''#33 Introduction to 3D Geometry''' | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
+ | <blockquote> | ||
Making 3D figures in asymptote is a bit different from making 2D figures in asymptote. I'll state some of the differences here. | Making 3D figures in asymptote is a bit different from making 2D figures in asymptote. I'll state some of the differences here. | ||
Line 1,131: | Line 1,169: | ||
<code>A = (x,y,z);</code> | <code>A = (x,y,z);</code> | ||
<math>x</math> and <math>y</math> are the coordinates of the base of the 3D figure, and <math>z</math> is the height of the coordinate on the 3D figure.[/quote] | <math>x</math> and <math>y</math> are the coordinates of the base of the 3D figure, and <math>z</math> is the height of the coordinate on the 3D figure.[/quote] | ||
+ | <blockquote></div></div> | ||
</dd> | </dd> |
Revision as of 12:57, 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
#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