@galihru/mnp-mie 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +38 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,18 +1,31 @@
1
1
  # @galihru/mnp-mie
2
2
 
3
3
  Rayleigh-limit scattering formulas for small spherical particles.
4
+ JavaScript port of the [mnpbem-mie](https://pypi.org/project/mnpbem-mie/) Python module.
4
5
 
5
- Implemented formulations:
6
+ ## Implemented Formulations
6
7
 
7
- $$
8
- \alpha = 4\pi a^3\frac{\varepsilon_p-\varepsilon_m}{\varepsilon_p+2\varepsilon_m}
9
- $$
8
+ ### Polarizability
10
9
 
11
- $$
12
- C_{\mathrm{ext}} = k\,\mathrm{Im}(\alpha),\quad
13
- C_{\mathrm{sca}} = \frac{|k|^4}{6\pi}|\alpha|^2,\quad
14
- C_{\mathrm{abs}} = C_{\mathrm{ext}}-C_{\mathrm{sca}}
15
- $$
10
+ ![α = 4πa³(εp−εm)/(εp+2εm)](https://latex.codecogs.com/svg.latex?\alpha=4\pi%20a^3\frac{\varepsilon_p-\varepsilon_m}{\varepsilon_p+2\varepsilon_m})
11
+
12
+ ### Wave Number in Medium
13
+
14
+ ![k = (2π/λ)√εm](https://latex.codecogs.com/svg.latex?k=\frac{2\pi}{\lambda}\sqrt{\varepsilon_m})
15
+
16
+ ### Cross Sections
17
+
18
+ Extinction:
19
+
20
+ ![C_ext = k Im(α)](https://latex.codecogs.com/svg.latex?C_{\mathrm{ext}}=k\,\mathrm{Im}(\alpha))
21
+
22
+ Scattering:
23
+
24
+ ![C_sca = |k|⁴/(6π)|α|²](https://latex.codecogs.com/svg.latex?C_{\mathrm{sca}}=\frac{|k|^4}{6\pi}|\alpha|^2)
25
+
26
+ Absorption:
27
+
28
+ ![C_abs = C_ext − C_sca](https://latex.codecogs.com/svg.latex?C_{\mathrm{abs}}=C_{\mathrm{ext}}-C_{\mathrm{sca}})
16
29
 
17
30
  ## Install
18
31
 
@@ -20,12 +33,24 @@ $$
20
33
  npm install @galihru/mnp-mie
21
34
  ```
22
35
 
23
- ## Usage
36
+ ## API
24
37
 
25
38
  ```js
26
- import { complex, rayleighCrossSections } from "@galihru/mnp-mie";
39
+ import { complex, rayleighPolarizability, rayleighCrossSections } from "@galihru/mnp-mie";
27
40
 
28
41
  const epsParticle = complex(-5.2, 2.1);
29
- const epsMedium = complex(1.77, 0.0);
30
- console.log(rayleighCrossSections(548.1, 50, epsParticle, epsMedium));
42
+ const epsMedium = complex(1.77, 0.0);
43
+
44
+ // Polarizability (radius in nm)
45
+ const alpha = rayleighPolarizability(50, epsParticle, epsMedium);
46
+
47
+ // Cross sections (wavelength in nm, radius in nm)
48
+ const cs = rayleighCrossSections(548.1, 50, epsParticle, epsMedium);
49
+ console.log(cs); // { ext: ..., sca: ..., abs: ... }
31
50
  ```
51
+
52
+ ## Author
53
+
54
+ **GALIH RIDHO UTOMO** — g4lihru@students.unnes.ac.id
55
+ License: GPL-2.0-only
56
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galihru/mnp-mie",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Rayleigh-limit scattering formulations for spherical particles.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",