Skip to content

tfpgh/polar_ascii

Repository files navigation

polar_ascii

polar_ascii graphs arbitrary polar functions in ASCII. It automatically scales the function over the given domain to fit within the terminal window.

Examples

heart.py
Heart Example
spiral_medium.py
Spiral Medium Example
flower.py
Flower Example

Usage

To graph a polar function, pass a python file defining the variable domain and function r into polar_ascii.py

Example function file (examples/spiral_medium.py):

import math

domain: tuple[float, float] = (0.0, 5 * math.pi)


def r(theta: float) -> float:
    return theta

Call it with:

python3 polar_ascii.py examples/spiral_medium.py

(or the path to your function file)