AoPSWiki
Looking for a challenging algebra text? Preparing for MATHCOUNTS or the AMC exams?
Check out Art of Problem Solving's Introduction to Algebra by Richard Rusczyk.

Asymptote: Filling

From AoPSWiki

Asymptote (Vector Graphics Language)
Getting Started - Basics - Reference - Examples - How to - Macros and Packages - Advanced Asymptote - Help

Useful functions - CSE5 Package

As explained in Asymptote: Drawing, you can create closed objects such as:

draw(origin--(5,0)--(3,4)--cycle);

draw(origin--(5,0)--(3,4)--cycle);

Now introducing the [b]fill()[/b] command. You would fill this triangle with green by the following:

fill(origin--(5,0)--(3,4)--cycle, green);

fill(origin--(5,0)--(3,4)--cycle, green);

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.

filldraw(origin--(5,0)--(3,4)--cycle, green, red+linewidth(1));

filldraw(origin--(5,0)--(3,4)--cycle, green, red+linewidth(1));

Want to learn how to tackle those tough MATHCOUNTS and AMC counting and probability problems? Check out Art of Problem Solving's Introduction to Counting & Probability by David Patrick.
© Copyright 2008 AoPS Incorporated. All Rights Reserved. • FoundationPrivacyContact Us