Skip to content

Commit

Permalink
Add logo (#95)
Browse files Browse the repository at this point in the history
* add logo image file and its source

* add misc page in the document
  • Loading branch information
hyrodium committed Jan 16, 2021
1 parent 771255c commit 0b3be86
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 10 deletions.
54 changes: 54 additions & 0 deletions docs/logo.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using FastGaussQuadrature, LinearAlgebra, Luxor
logocolors = Luxor.Colors.JULIA_LOGO_COLORS

@svg begin
n = 15
Drawing(500,500, "docs/src/assets/logo.svg")
origin()
unitlength = 210
translate(0, unitlength)

Y = (n+1/2)/π

x_lgd, w_lgd = gausslegendre(n)
x_cbs, w_cbs = gausschebyshev(n,3)
x_jcb, w_jcb = gaussjacobi(n,5/2,1/2)

c_lgd = logocolors[1] # Red
c_cbs = logocolors[2] # Green
c_jcb = logocolors[4] # Purple

p_jcb = [Point(unitlength*x_jcb[i], -Y*unitlength*w_jcb[i]) for i in 1:n]
p_cbs = [Point(unitlength*x_cbs[i], -Y*unitlength*w_cbs[i]) for i in 1:n]
p_lgd = [Point(unitlength*x_lgd[i], -Y*unitlength*w_lgd[i]) for i in 1:n]

l_jcb = [norm(p_jcb[i+1]-p_jcb[i]) for i in 1:n-1]
l_cbs = [norm(p_cbs[i+1]-p_cbs[i]) for i in 1:n-1]
l_lgd = [norm(p_lgd[i+1]-p_lgd[i]) for i in 1:n-1]

r_jcb = zeros(n)
r_cbs = zeros(n)
r_lgd = zeros(n)

r_jcb[end] = norm(l_jcb[end])/2 * 0.8
r_cbs[end] = norm(l_cbs[end])/2 * 0.7
r_lgd[end] = norm(l_lgd[end])/2 * 0.75

for i in reverse(1:n-1) r_jcb[i] = l_jcb[i] - r_jcb[i+1] end
for i in reverse(1:n-1) r_cbs[i] = l_cbs[i] - r_cbs[i+1] end
for i in reverse(1:n-1) r_lgd[i] = l_lgd[i] - r_lgd[i+1] end

sethue(c_cbs)
for i in 5:n circle(p_cbs[i], r_cbs[i], :fill) end
sethue(c_jcb)
for i in 1:n circle(p_jcb[i], r_jcb[i], :fill) end
sethue(c_lgd)
for i in 1:n circle(p_lgd[i], r_lgd[i], :fill) end
sethue(c_cbs)
for i in 1:4 circle(p_cbs[i], r_cbs[i], :fill) end

finish()
preview()
end

run(`convert -density 256x256 -background transparent docs/src/assets/logo.svg -define icon:auto-resize -colors 256 docs/src/assets/favicon.ico`)
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ makedocs(;
"Gaussian Quadrature" => "gaussquadrature.md",
"Benchmark" => "benchmark.md",
"Roots of Bessel function" => "besselroots.md",
"Misc." => "misc.md",
"References" => "reference.md",
],
repo = "https://github.com/JuliaApproximation/FastGaussQuadrature.jl/blob/{commit}{path}#L{line}",
Expand Down
Binary file added docs/src/assets/favicon.ico
Binary file not shown.
50 changes: 50 additions & 0 deletions docs/src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions docs/src/misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Misc.

## About the logo
![](assets/logo.svg)

* The center points of circles are generated from nodes(x-axis) and weights(y-axis) of Gaussian quadrature.
* Number of points : `n = 15`
* ``\textcolor{#CB3C33}{\text{\textbf{Red}}}`` : `gausslegendre(n)`
* ``\textcolor{#389826}{\text{\textbf{Green}}}`` : `gausschebyshev(n, 3)`
* ``\textcolor{#9558B2}{\text{\textbf{Purple}}}`` : `gaussjacobi(n, 5/2, 1/2)`
* These colors are from [julia-logo-graphics](https://github.com/JuliaLang/julia-logo-graphics).
* The logo is generated with [Luxor.jl](https://github.com/JuliaGraphics/Luxor.jl), and its source code is [here](https://github.com/JuliaApproximation/FastGaussQuadrature.jl/blob/master/docs/logo.jl).


## Other docstrings from private methods

```@autodocs
Modules = [FastGaussQuadrature]
Private = true
Public = false
```
2 changes: 1 addition & 1 deletion src/gaussjacobi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ end
"""
Evaluate the interior asymptotic formula at x = cos(t).
Assumption:
* length(t) == n ÷ 2
* `length(t) == n ÷ 2`
"""
function feval_asy1(n::Integer, α::Float64, β::Float64, t::AbstractVector, idx)
# Number of terms in the expansion:
Expand Down
13 changes: 4 additions & 9 deletions src/gausslaguerre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,11 @@ const airy_roots = [-2.338107410459767, -4.08794944413097, -5.520559828095551,


"""
Compute the Gauss-Laguerre rule using explicit asymptotic expansions for the nodes
and weights.
Compute the Gauss-Laguerre rule using explicit asymptotic expansions for the nodes and weights.
Optional parameters are:
- `reduced`: compute a reduced quadrature rule, discarding all points and weights
as soon as the weights underflow
- `T`: the order of the expansion. Set `T=-1` to determine the order adaptively
depending on the size of the terms in the expansion
- `recompute`: if a crude measure of the error is larger than a tolerance,
the point and weight are recomputed using the (slower) recursion+newton approach,
yielding more reliable accurate results.
- `reduced`: compute a reduced quadrature rule, discarding all points and weights as soon as the weights underflow
- `T`: the order of the expansion. Set `T=-1` to determine the order adaptively depending on the size of the terms in the expansion
- `recompute`: if a crude measure of the error is larger than a tolerance, the point and weight are recomputed using the (slower) recursion+newton approach, yielding more reliable accurate results.
"""
function gausslaguerre_asy(n::Integer, α;
reduced = false,
Expand Down

0 comments on commit 0b3be86

Please sign in to comment.