Mathematically is it possible to create a function that represents a shape. Such as a cube or sphere?

100 Views Asked by At

Like utilizing vectors, calculus, differential equations? Is it possible, i am specifically looking at cube or sphere as i know a cone can be easily created by rotating a simple function around the y axis by 2(pi) creating a cone but how would one create a function for a sphere or cube?

2

There are 2 best solutions below

0
On

A sphere can be defined parametrically as follows:

$$(r \cos θ_1 \cosθ_2, r\cos θ_1 \sinθ_2,r\sin θ_1)$$ for $ 0 ≤ θ_1, θ_2 < 2 π $ where $r$ is the radius of the sphere.

Alternatively, as mentioned by Zestylemonzi, you could rotate the function $ y = \sqrt{r^2 - x^2}$ across the x-axis, again where $r$ is the radius of the sphere.

A cube is a little more tricky as it cannot be described by a single function (to my knowledge). However, the three-dimensional region where $0 ≤ x, y, z ≤ s$, where $s$ is the side length of the cube seems to fit the conditions of the problem.

0
On

You want to generate a surface area.

Like the cone choose a circle centered on y axis and rotate it around y axis to form a sphere.

To form one of 6 faces of a cube length $2$ define that by varying $x,y,z$ as

$$ x=1 \, , (-1<y< 1),\, (-1<z< 1)\,. $$

In Mathematica

ParametricPlot3D[ {1, y, z}, {y, -1, 1}, {z, -1, 1}]