You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Approximation of pi and plotting example (Logan1x#11)
* Uploaded pi approximation and plotting example scripts. Updated README.
* Updated README.
* Previous status.
* Uploaded pi approximation and plotting example scripts. Updated README.
Copy file name to clipboardExpand all lines: README.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,25 @@ Directly prints results if run directly.
111
111
May also be imported, yielding results one by one.
112
112
113
113
114
+
### Approximating *pi*
115
+
116
+
This script is useful to show a way to approximate the value of pi using a Monte Carlo method. It is also optimized using the `@jit` (*just-in-time*) decorator from the [numba](https://numba.pydata.org/) library.
117
+
118
+
To see different approximations you just need to modify the argument passed to the main function.
119
+
120
+
```bash
121
+
python pi.py
122
+
```
123
+
124
+
125
+
### Plotting a function
126
+
127
+
This script contains an example of plotting a function using [`matplotlib`](http://matplotlib.org/). Feel free to modify the value of `y` to obtain different functions that depend on `x`.
128
+
129
+
```bash
130
+
python plot_example.py
131
+
```
132
+
114
133
## Release History
115
134
116
135
* 0.0.1
@@ -141,4 +160,4 @@ The following people helped in creating the above content.
0 commit comments