Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dudung committed Dec 15, 2024
1 parent 9dd8332 commit a4e172a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,31 @@ y2 = -2 + x^1
y3 = -2 + 5x - 8x^2 + 3x^3
```

```py
from lumpur.num.polynomial import Polynomial
from lumpur.viz.plot.polynomial import plot_polynomial

p1 = Polynomial([-1, 1])
p2 = Polynomial([-3, 1])
p3 = Polynomial([-5, 1])
p4 = Polynomial([-7, 1])
p = p1 * p2 * p3 * p4
dp = p.differentiate()
d2p = dp.differentiate()
d3p = d2p.differentiate()
d4p = d3p.differentiate()
d5p = d4p.differentiate()
x = [0.1*i for i in range(10, 71)]

plot_polynomial(x, p, label='p')
plot_polynomial(x, dp, label='dpdx')
plot_polynomial(x, d2p, label='d2p/dx2')
plot_polynomial(x, d3p, label='d3p/dx3')
plot_polynomial(x, d4p, label='d4p/dx4')
```
<img src="https://raw.githubusercontent.com/dudung/lumpur/refs/heads/main/docs/images/polynomial.png" width="300" />


### circular decision boundary
$$
0.41 - 0.8x - 1.2y + x^2 + y^2 = 0
Expand Down

0 comments on commit a4e172a

Please sign in to comment.