Asymptote: Example 1

Asymptote (Vector Graphics Language)
Getting Started - Basics - Drawing - Labeling - Filling - Useful functions - Examples - Macros and Packages

Help - Reference - Advanced Asymptote - 3D Graphics - CSE5 Package - How to

size(200); 
import olympiad; 

//definitions 
pair A=origin, B=(4,0), C=(4,2), D=(0,2), E=(2,2); 
path p1=(A--C); 
path p2=(E--B); 

//draw 
draw(A--B--C--D--cycle); 
draw(p1); 
draw(p2); 
dot((A)); 
dot((B)); 
dot((C)); 
dot((D)); 
dot((E)); 
dot((IP(p1,p2))); 

//label 
label("A",A,SW); 
label("B",B,SE); 
label("C",C,NE); 
label("D",D,NW); 
label("E",E,N); 
label("F", IP(p1,p2),S);

[asy] size(200);  import olympiad;   //definitions  pair A=origin, B=(4,0), C=(4,2), D=(0,2), E=(2,2);  path p1=(A--C);  path p2=(E--B);   //draw  draw(A--B--C--D--cycle);  draw(p1);  draw(p2);  dot((A));  dot((B));  dot((C));  dot((D));  dot((E));  dot((IP(p1,p2)));   //label  label("A",A,SW);  label("B",B,SE);  label("C",C,NE);  label("D",D,NW);  label("E",E,N);  label("F", IP(p1,p2),S); [/asy]

For definitions, see Olympiad Package Part 1: Value Setting.

For drawing, see Drawing.

For labeling, see Labeling.