```python
%run header.ipynb

from sympy.physics.units import meter, m
from tabulate import tabulate
```

# Inputs


```python
# Inputs are many circles
diameters = [11.1 * m, 22.2 * m, 33.3 * m, 44.4 * m, 55.5 * m]
```


```python
# Setup global values registry.
values={"d": diameters[0]}

Formula.set_global_values(values)
```


```python
diameters_latex = Math(", ".join(sympy.latex(dia) for dia in diameters))
```

We consider {{ len(diameters) }} circles with diameters {{diameters_latex}}.

# Area


```python
%run "Circle Area.ipynb"
```

The area of a circle with diameter {{ d.get_inline() }} is:

{{ area_formula.get_display(oneline=False) }}

# Circumference


```python
%run "Circle Circumference.ipynb"
```

The circumference of a circle with diameter {{ d.get_inline() }} is:

{{ circ_formula.get_display(oneline=True) }}

# Summary


```python
# Summarize just the first circle

# the area and circumference formulas use the value of `d` from the `values` dict.
values["d"] = diameters[0]

# Print out just one circle to demonstrate Markdown tables
```

First circle:

| d                    | Area                           | Circumference                    |
| ---:                 |    ----:                       |          ---:                    |
| {{d.get_inlinev()}}  | {{area_formula.get_inlinev()}} | {{circ_formula.get_inlinev()}}   |


```python
# Summarize all circles to demonstrate a way to loop

table_data = [["d", "Area", "Circumference"]]
for dia in diameters:
    # formulas use the value of `d` from the `values` dict.
    values["d"] = dia
    
    # populate table
    table_data.append([
        d.get_inlinev_latex(),
        area_formula.get_inlinev_latex(),
        circ_formula.get_inlinev_latex(),
    ])

t = tabulate( # library for pretty-printing tables in many useful formats
    table_data, # list of lists table
    headers="firstrow", # first element in the list is the table header
    tablefmt="pipe", # markdown format that supports alignment
    colalign=("right", "right", "right") # cell aligments
)
table = Markdown(t)

### THIS CURRENTLY ONLY WORKS IN THE NOTEBOOK, DOES NOT YET WORK IN THE PDF!!
```

All circles:

{{ table }}


```python

```

cad1d98e70580c6fb21fdd8818e666c48c138830
ipynb
Jupyter Notebook
notebooks/Circle multifile/Circle Main.ipynb
alugowski/jupyter-forchaps
c46904286df8b60a8e5200e0c8b6bafca3379c9d
BSD-2-Clause
2020-02-12T11:25:37.000Z
2020-02-12T11:25:37.000Z
notebooks/Circle multifile/Circle Main.ipynb
alugowski/jupyter-forchaps
c46904286df8b60a8e5200e0c8b6bafca3379c9d
BSD-2-Clause
notebooks/Circle multifile/Circle Main.ipynb
alugowski/jupyter-forchaps
c46904286df8b60a8e5200e0c8b6bafca3379c9d
BSD-2-Clause
Qwen/Qwen-72B
1. YES
2. YES