# torus()

## Example

<figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2F3fD22FDKqfN8gQaNShMG%2Ftorus%20simple.PNG?alt=media&#x26;token=2968ab01-5e5c-4b14-b5b9-6a98523dd2db" alt=""><figcaption></figcaption></figure>

## Syntax

```python
torus([radius], [tubeRadius], [detailX], [detailY])
```

<table><thead><tr><th width="140">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>radius</td><td>radius of the ring</td></tr><tr><td>tubeRadius</td><td>radius of the tube</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)
  torus(75, 35)
```

</details>

<figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2FUjbwRubKv3xqf8Z2hcVF%2Ftorus%20full.gif?alt=media&#x26;token=14df4ec0-dc80-4b90-97ad-ce5308866727" alt=""><figcaption></figcaption></figure>

## Description

draws a torus (donut-like shape) with a specified radius of its ring and a specified radius of the circular cross section if its tube.

{% 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 %}
