Wolfram Language Fast Introduction for Math Students
Get Started »

Geometry

The Graphics command generates all kinds of 2D shapes:

In[1]:=
Click for copyable input
Graphics[Disk[]]
Out[1]=

Many geometric objects take a series of coordinates (lists) as arguments:

In[2]:=
Click for copyable input
Graphics[Rectangle[{0, 0}, {4, 2}]]
Out[2]=

Pass in a list with directives to combine graphics and change their styles:

In[3]:=
Click for copyable input
Graphics[{Green, Rectangle[{0, 0}, {2, 2}], Red, Disk[]}]
Out[3]=

Generate triangles with commands like SASTriangle:

(Type ESCdegESC for the ° symbol.)
In[1]:=
Click for copyable input
tr = SASTriangle[1, 90 \[Degree], 2]
Out[1]=

Properties like area can be computed directly:

In[2]:=
Click for copyable input
Area[tr]
Out[2]=

Pass this expression into Graphics:

In[3]:=
Click for copyable input
Graphics[tr]
Out[3]=

Similarly, you can use Graphics3D to display 3D objects:

In[1]:=
Click for copyable input
Graphics3D[Ball[]]
Out[1]=

Calculate volume and other properties:

(With no arguments given, a cylinder has a radius of 1 and a height of 2.)
In[2]:=
Click for copyable input
Volume[Cylinder[]]
Out[2]=

You can also find formulas and other information using natural-language input:

In[3]:=
X
volume of a cone
Out[3]=

Geometric transformations like Rotate, Translate and Scale are built in:

In[1]:=
Click for copyable input
Graphics[Rotate[Rectangle[], 45 \[Degree]]]
Out[1]=

QUICK REFERENCE: Plane Geometry »

QUICK REFERENCE: Solid Geometry »

QUICK REFERENCE: Geometric Transforms »