Basic Graphics Objects

In the Wolfram Language, Circle[ ] represents a circle. To display the circle as graphics, use the function Graphics. Later, we’ll see how to specify the position and size of a circle. But for now, we’re just going to deal with a basic circle, which doesn’t need any additional input.

Graphics[Circle[ ]]

Graphics[Disk[ ]]

RegularPolygon gives a regular polygon with however many sides you specify.

Graphics[RegularPolygon[5]]

Table[Graphics[RegularPolygon[n]],{n,5,10}]

Style works inside Graphics, so you can use it to give colors.

Graphics[Style[RegularPolygon[5],Orange]]

The Wolfram Language works in 3D as well as 2D, with constructs such as Sphere, Cylinder and Cone. When you have 3D graphics, you can rotate them around interactively to see different angles.

Graphics3D[Sphere[ ]]

{Graphics3D[Cone[ ]],Graphics3D[Cylinder[ ]]}

Graphics3D[Style[Sphere[ ],Yellow]]

Use RegularPolygon to draw a triangle. »

Make graphics of a red circle. »

Make a red octagon. »

Make a list whose elements are disks with hues varying from 0 to 1 in steps of 0.1. »

Make a column of a red and a green triangle. »

Make a list giving the regular polygons with 5 through 10 sides, with each polygon being colored pink. »

Make a graphic of a purple cylinder. »

Make a list of polygons with 8, 7, 6, ... , 3 sides, and colored with RandomColor, then show them all overlaid with the triangle on top (hint: apply Graphics to the list). »

Make a list of 10 regular pentagons with random colors.  »

Make a list of a 20-sided regular polygon and a disk. »

Make a list of polygons with 10, 9, ... , 3 sides. »

How can I make graphics with several objects?

Section 14 will explain. To do so requires understanding coordinates.

Why use Circle[ ], not just Circle?

For consistency. As we’ll see in Section 14, Circle[ ] is actually short for Circle[{0,0},1], which means a circle of radius 1 and center coordinates {0,0}.

Why isn’t the yellow sphere pure yellow?

Because the Wolfram Language displays it like an actual 3D object, with lighting. If it were pure yellow, you wouldn’t see any 3D depth, and it would just look like a 2D disk.

Tech Note