Skip to content

Commit e122f81

Browse files
committed
docs: improve mathematical notation in gallery files
- Updated mathematical expressions in gallery_star.cpp and gallery_statistical_distributions.cpp to use LaTeX formatting for clarity. - Enhanced descriptions of statistical distributions and their probability density functions in gallery_statistical_distributions.cpp.
1 parent b8ab875 commit e122f81

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

gallery/gallery_star.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
*
2222
* Mathematical concepts:
2323
* - Star geometry with alternating outer and inner radii
24-
* - Angular positioning using multiples of π/5 (36-degree increments)
25-
* - Polar-to-Cartesian coordinate transformation: \f$x = r·cos(θ)\f$, \f$y =
26-
* r·sin(θ)\f$
24+
* - Angular positioning using multiples of \f$\pi/5\f$ (36-degree increments)
25+
* - Polar-to-Cartesian coordinate transformation: \f$x = r·cos(\theta)\f$, \f$y
26+
* = r·sin(\theta)\f$
2727
* - Path completion by connecting back to the starting point
2828
*
2929
* The star shape is created with outer radius 1.0, inner radius 0.4, and

gallery/gallery_statistical_distributions.cpp

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,35 @@
2121
* - Random number generation and statistical sampling techniques
2222
*
2323
* Statistical distributions implemented:
24-
* - Normal distribution: N(μ=2, σ=1) with standard bell curve shape
25-
* - Exponential distribution: Exp(λ=0.5) showing exponential decay
26-
* - Gamma distribution: Γ(k=2, θ=1.5) with shape and scale parameters
24+
* - Normal distribution: \f$\mathcal{N}(\mu=2, \sigma=1)\f$ with standard bell
25+
* curve shape
26+
* - Exponential distribution: \f$\mathrm{Exp}(\lambda=0.5)\f$ showing
27+
* exponential decay
28+
* - Gamma distribution: \f$\Gamma(k=2, \theta=1.5)\f$ with shape and scale
29+
* parameters
2730
* - Empirical normal samples: 1000 random samples for comparison
2831
*
29-
* Mathematical concepts:
30-
* - Probability density functions and their mathematical formulations
32+
* Mathematical concepts and formulas:
33+
* - **Normal Distribution PDF**:
34+
* \f[
35+
* f(x|\mu,\sigma) = \frac{1}{\sigma\sqrt{2\pi}}
36+
* e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2}
37+
* \f]
38+
* - **Exponential Distribution PDF**:
39+
* \f[
40+
* f(x|\lambda) = \lambda e^{-\lambda x} \quad \mathrm{for } x \geq 0
41+
* \f]
42+
* - **Gamma Distribution PDF**:
43+
* \f[
44+
* f(x|k,\theta) = \frac{x^{k-1}e^{-x/\theta}}{\Gamma(k)\theta^k} \quad
45+
* \mathrm{for } x > 0
46+
* \f]
3147
* - Random sampling and empirical distribution estimation
3248
* - Statistical distribution parameters and their effects on shape
33-
* - Gamma function usage in probability calculations
49+
* - **Gamma function**:
50+
* \f[
51+
* \Gamma(k) = \int_0^\infty t^{k-1}e^{-t}dt
52+
* \f]
3453
*
3554
* @image html statistical_distributions.png "Statistical Distributions
3655
* Comparison"

0 commit comments

Comments
 (0)