Difference between revisions of "Asymptote: How to"

(Drawing)
(Formatting)
 
(21 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{Asymptote}}
 
{{Asymptote}}
=Filling=
 
As explained above, you can create closed objects such as:
 
  
<tt>draw(origin--(5,0)--(3,4)--cycle);</tt>
+
== Basics ==
  
<asy>
+
* [[Asymptote: Drawing|Drawing]]
draw(origin--(5,0)--(3,4)--cycle);
+
* [[Asymptote: Filling|Filling]]
</asy>
+
* [[Asymptote: Labeling|Labeling]]
 +
* [[Asymptote: Marking Angles|Marking Angles]]
 +
* [[Asymptote: Basics#Syntax|Using Asymptote on Aops Wiki]]
  
Now introducing the [b]fill()[/b] command. You would fill this triangle with green by the following:
+
== Intermediate ==
  
<tt>fill(origin--(5,0)--(3,4)--cycle, green);</tt>
+
* [[Asymptote: Graphing|Graphing]]
 +
* [[Asymptote: Olympiad Package Part 1|Olympiad Package Basics]]
  
<asy>
+
== Advanced ==
fill(origin--(5,0)--(3,4)--cycle, green);
 
</asy>
 
 
 
Note how there is no outline. To create an outline and fill, without making two different statements, use the '''filldraw()''' command. Like the order of filldraw, you put the color of the fill before the draw.
 
 
 
<tt>filldraw(origin--(5,0)--(3,4)--cycle, green, red+linewidth(1));</tt>
 
 
 
<asy>
 
filldraw(origin--(5,0)--(3,4)--cycle, green, red+linewidth(1));
 
</asy>
 

Latest revision as of 19:05, 22 March 2025