https://github.com/gmagno/nb-cpp
Newton Basins implementation in C++ with bindings (pybind11)
https://github.com/gmagno/nb-cpp
cpp newton-fractals pybind11 python
Last synced: 6 months ago
JSON representation
Newton Basins implementation in C++ with bindings (pybind11)
- Host: GitHub
- URL: https://github.com/gmagno/nb-cpp
- Owner: gmagno
- Created: 2019-01-21T18:36:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T18:28:00.000Z (over 3 years ago)
- Last Synced: 2025-03-24T20:11:26.613Z (about 1 year ago)
- Topics: cpp, newton-fractals, pybind11, python
- Language: Python
- Size: 10.7 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Newton Basins C++ Implementation (pybind11)
A Python/C++ (pybind11) package to generate newton basins images.
## Installation
### From PyPI
```
pip install nb-cpp
```
### From source code
```
pip install git+https://github.com/gmagno/nb-cpp.git
```
or
```
git clone git@github.com:gmagno/nb-cpp.git
cd nb-cpp/
make install
```
## Example Usage
Just run:
```python
import matplotlib as mpl # don't forget to `pip install matplotlib` first
import matplotlib.pyplot as plt
import nb_cpp
hsv = nb_cpp.compute(
imw=32, imh=32, # for more details, run: help(nb_py.compute)
)
rgb = mpl.colors.hsv_to_rgb(hsv)
plt.figure()
plt.imshow(rgb)
plt.show()
```
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details