> 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/cone.md).

# cone()

## Example

<figure><img src="/files/5Doj8UO7Ppmdg10CCH3k" alt=""><figcaption></figcaption></figure>

## Syntax

```python
cone([radius], [height], [detailX], [detailY], [cap])
```

<table><thead><tr><th width="140">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>radius</td><td>radius of the cone</td></tr><tr><td>height</td><td>height of the cone</td></tr><tr><td>cap</td><td>a boolean to specify whether or not the cone should be closed with a cap</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)
  cone(100, 150)
```

</details>

<figure><img src="/files/MLuYNu2Oy0f1JvOjTcLC" alt=""><figcaption></figcaption></figure>

<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)
  cone(100, 150, 16, 16, False)
```

</details>

<figure><img src="/files/czh9SRjmGwJLnJTfQPuH" alt=""><figcaption></figcaption></figure>

## Description

draws a cone with a specified radius and height. A cap that closes the cone is drawn by default, and can be removed by setting `cap = False`

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