rm WeaveSupport
This commit is contained in:
@@ -17,21 +17,6 @@ using RealPolynomialRoots
|
||||
The `Polynomials` package is "imported" to avoid naming collisions with `SymPy`; names will need to be qualified.
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
#| results: "hidden"
|
||||
using CalculusWithJulia.WeaveSupport
|
||||
|
||||
const frontmatter = (
|
||||
title = "Rational functions",
|
||||
description = "Calculus with Julia: Rational functions",
|
||||
tags = ["CalculusWithJulia", "precalc", "rational functions"],
|
||||
);
|
||||
|
||||
using Roots
|
||||
|
||||
nothing
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -427,41 +412,6 @@ The usual recipe for construction follows these steps:
|
||||
With the computer, where it is convenient to draw a graph, it might be better to emphasize the sign on the graph of the function. The `sign_chart` function from `CalculusWithJulia` does this by numerically identifying points where the function is $0$ or $\infty$ and indicating the sign as $x$ crosses over these points.
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
# in CalculusWithJuia
|
||||
function sign_chart(f, a, b; atol=1e-6)
|
||||
pm(x) = x < 0 ? "-" : x > 0 ? "+" : "0"
|
||||
summarize(f,cp,d) = (∞0=cp, sign_change=pm(f(cp-d)) * " → " * pm(f(cp+d)))
|
||||
|
||||
zs = find_zeros(f, a, b)
|
||||
pts = vcat(a, zs, b)
|
||||
for (u,v) ∈ zip(pts[1:end-1], pts[2:end])
|
||||
zs′ = find_zeros(x -> 1/f(x), u, v)
|
||||
for z′ ∈ zs′
|
||||
flag = false
|
||||
for z ∈ zs
|
||||
if isapprox(z′, z, atol=atol)
|
||||
flag = true
|
||||
break
|
||||
end
|
||||
end
|
||||
!flag && push!(zs, z′)
|
||||
end
|
||||
end
|
||||
sort!(zs)
|
||||
|
||||
length(zs) == 0 && return []
|
||||
m,M = extrema(zs)
|
||||
d = min((m-a)/2, (b-M)/2)
|
||||
if length(zs) > 0
|
||||
d′ = minimum(diff(zs))/2
|
||||
d = min(d, d′ )
|
||||
end
|
||||
summarize.(f, zs, d)
|
||||
end
|
||||
```
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
f(x) = x^3 - x
|
||||
@@ -1046,4 +996,3 @@ L"The $\sin(x)$ oscillates, but the rational function has a horizontal asymptote
|
||||
answ = 2
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user