3D Graphing

This page is outdated. Desmos now has a 3D graphing calculator. Click the URL to access it: https://www.desmos.com/3d

3D graphing is not available in Desmos. To achieve a pseudo-3D effect, you can create a function that maps

(
x
,
y
,
z
)

{\displaystyle (x, y, z)}

 coordinates to an

(
x
,
y
)

{\displaystyle (x,y)}

 plane. This graph that was made by u/SociableFish97 on Reddit accomplished this goal by creating a function called

f

3
d
t
o
2
d

(

x
0

,

y
0

,

z
0

)

{\displaystyle f\_{3dto2d}(x\_0,y\_0,z\_0)}

 and you can see it to the right. Unfortunately,

f

3
d
t
o
2
d

(

x
0

,

y
0

,

z
0

)

{\displaystyle f\_{3dto2d}(x\_0,y\_0,z\_0)}

 equals a long and complicated expression because 3D graphing is hard. Nonetheless, many 3D graphs use it like this graph which shows a random walk of 10,000 steps and a car graph which was the end result of a game where people were one-upping each other's graphs. There are many things that you can do with 3D graphing, though.

## Parametric Objects

   You can create 3D parametric curves by defining the functions

f
x

{\displaystyle f\_x}

,

f
y

{\displaystyle f\_y}

, and

f
z

{\displaystyle f\_z}

 and then pasting in this expression and modifying the bounds for t:

`f_{3dto2d}\left(f_{x}\left(t\right),f_{y}\left(t\right),f_{z}\left(t\right)\right)`

A possible result is shown to the left. You can also create parametric surfaces through a more complicated process. First, define the variables and function

x

m
i
n

{\displaystyle x\_{min}}

,

x

m
a
x

{\displaystyle x\_{max}}

,

y

m
i
n

{\displaystyle y\_{min}}

,

y

m
a
x

{\displaystyle y\_{max}}

,

x

r
e
s

{\displaystyle x\_{res}}

,

y

r
e
s

{\displaystyle y\_{res}}

, and

f

p
a
r
a
m

(

x

p
a
r
a
m

,

y

p
a
r
a
m

)

{\displaystyle f\_{param}\left(x\_{param},y\_{param}\right)}

. The variables

[
x

y

]

[
m
i
n

m
a
x
]

{\displaystyle [x|y]\_{[min|max]}}

 define the bounds for the parameters x and y and

[
x

y

]

r
e
s

{\displaystyle [x|y]\_{res}}

 are simply 2 numbers that represent the resolution of the plot for a certain parameter that should be no smaller than 100 each.

f

p
a
r
a
m

(

x

p
a
r
a
m

,

y

p
a
r
a
m

)

{\displaystyle f\_{param}\left(x\_{param},y\_{param}\right)}

 should be a function that takes 2 inputs and gives an output in the form of a 3-element list where the indices represent the x, y, and z coordinates of a 3D point. Then, paste in this monster of an expression:

`\left[\operatorname{polygon}\left(f_{3dto2d}\left(f_{param}\left(x_{index},y_{index}\right)\left[1\right],f_{param}\left(x_{index},y_{index}\right)\left[2\right],f_{param}\left(x_{index},y_{index}\right)\left[3\right]\right),f_{3dto2d}\left(f_{param}\left(x_{index}+\frac{x_{max}-x_{min}}{x_{res}},y_{index}\right)\left[1\right],f_{param}\left(x_{index}+\frac{x_{max}-x_{min}}{x_{res}},y_{index}\right)\left[2\right],f_{param}\left(x_{index}+\frac{x_{max}-x_{min}}{x_{res}},y_{index}\right)\left[3\right]\right),f_{3dto2d}\left(f_{param}\left(x_{index}+\frac{x_{max}-x_{min}}{x_{res}},y_{index}+\frac{y_{max}-y_{min}}{y_{res}}\right)\left[1\right],f_{param}\left(x_{index}+\frac{x_{max}-x_{min}}{x_{res}},y_{index}+\frac{y_{max}-y_{min}}{y_{res}}\right)\left[2\right],f_{param}\left(x_{index}+\frac{x_{max}-x_{min}}{x_{res}},y_{index}+\frac{y_{max}-y_{min}}{y_{res}}\right)\left[3\right]\right),f_{3dto2d}\left(f_{param}\left(x_{index},y_{index}+\frac{y_{max}-y_{min}}{y_{res}}\right)\left[1\right],f_{param}\left(x_{index},y_{index}+\frac{y_{max}-y_{min}}{y_{res}}\right)\left[2\right],f_{param}\left(x_{index},y_{index}+\frac{y_{max}-y_{min}}{y_{res}}\right)\left[3\right]\right)\right)\operatorname{for}x_{index}=\left[x_{min},x_{min}+\frac{x_{max}-x_{min}}{x_{res}}...x_{max}-\frac{x_{max}-x_{min}}{x_{res}}\right],y_{index}=\left[y_{min},y_{min}+\frac{y_{max}-y_{min}}{y_{res}}...y_{max}-\frac{y_{max}-y_{min}}{y_{res}}\right]\right]`

You can now change

[
x

y

]

[
m
i
n

m
a
x
]

{\displaystyle [x|y]\_{[min|max]}}

,

[
x

y

]

r
e
s

{\displaystyle [x|y]\_{res}}

, and

f

p
a
r
a
m

{\displaystyle f\_{param}}

 to whatever you want. Look at the table below for various numbers to plug in to the variables to get various shapes.