> For the complete documentation index, see [llms.txt](https://learnpython.strivemath.com/p5-python-web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnpython.strivemath.com/p5-python-web/reference/shapes/3d/sphere.md).

# sphere()

Sphere - Draws a 2-sphere (sphere in 3D space)

## Example

<figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2FvlhCPhU6ZAGn8sghu8HU%2Fsphere%20simple.PNG?alt=media&amp;token=e0d52244-2750-4f7d-8c22-be14d2c650b4" alt=""><figcaption></figcaption></figure>

## Syntax

```python
sphere([radius], [detailX], [detailY])
```

<table><thead><tr><th width="140">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>radius</td><td>radius of the sphere</td></tr></tbody></table>

<details>

<summary>Example Full Code</summary>

```python
def setup():
  createCanvas(300,300, WEBGL)

def draw():
  background(255, 79, 132)
  orbitControl()
  stroke(176, 235, 51)
  fill(112, 88, 255)
  strokeWeight(2)

  r = frameCount
  rotateX(r)
  rotateY(-r)
  rotateZ(r)
  sphere(100)
```

</details>

<figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2Fb6zF6ECSWGychunqInPj%2Fsphere%20full.gif?alt=media&amp;token=c7321cdb-1890-4e75-98aa-98fbdb7e0712" alt=""><figcaption></figcaption></figure>

## Description

draws a **UV** sphere with a specified radius.

{% hint style="info" %}
Find these documents helpful? Let the people who made them help your child learn to code at [**Strivemath**](https://www.strivemath.com/)<mark style="color:blue;">**!**</mark>

We'd love to hear your Feedback/Comments [here](https://docs.google.com/forms/d/e/1FAIpQLSeqorBAGTya-YBRI-VFjJxtgQtCz3ucGDI96K96sNyuaGuvdw/viewform?usp=sf_link).
{% endhint %}
