👎Deprecated since 0.1.3: This crate is no longer maintained. Use the
complex-bessel crate instead.Expand description
§zbessel-rs
A library that provides complex Bessel functions and Airy functions for Rust.
§Simple Usage
use num_complex::Complex64;
use zbessel_rs::{J, Y, I, K, Ai, Bi, J_scaled, Y_scaled, I_scaled, K_scaled, Ai_scaled, Bi_scaled};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let z = Complex64::new(1.0, 0.5);
// Bessel functions (order, variable order)
let j0 = J(0.0, z)?; // J_0(z)
let j1 = J(1.0, z)?; // J_1(z)
let y0 = Y(0.0, z)?; // Y_0(z)
let i0 = I(0.0, z)?; // I_0(z)
let k0 = K(0.0, z)?; // K_0(z)
// Airy functions
let ai_val = Ai(z)?; // Ai(z)
let bi_val = Bi(z)?; // Bi(z)
// Scaled versions (useful for large arguments)
let j0_scaled = J_scaled(0.0, z)?; // J_0(z) with scaling
let i0_scaled = I_scaled(0.0, z)?; // I_0(z) with scaling
let ai_scaled = Ai_scaled(z)?; // Ai(z) with scaling
println!("J_0({}) = {}", z, j0);
println!("Y_0({}) = {}", z, y0);
println!("I_0({}) = {}", z, i0);
println!("K_0({}) = {}", z, k0);
println!("Ai({}) = {}", z, ai_val);
println!("Bi({}) = {}", z, bi_val);
println!("J_0({}) (scaled) = {}", z, j0_scaled);
println!("I_0({}) (scaled) = {}", z, i0_scaled);
println!("Ai({}) (scaled) = {}", z, ai_scaled);
Ok(())
}§Advanced Usage
For multiple value calculations or scaling:
use num_complex::Complex64;
use zbessel_rs::{bessel_j, bessel_i, airy_ai};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let z = Complex64::new(2.0, 1.0);
// Calculate multiple orders at once: J_0(z), J_1(z), J_2(z)
let result = bessel_j(z, 0.0, 1, 3)?;
for (n, value) in result.values.iter().enumerate() {
println!("J_{}({}) = {}", n, z, value);
}
// Scaled result (kode=2)
let scaled = bessel_i(z, 0.0, 2, 1)?;
println!("I_0({}) (scaled) = {}", z, scaled.values[0]);
// Airy function derivative (id=1)
let ai_prime = airy_ai(z, 1, 1)?;
println!("Ai'({}) = {}", z, ai_prime);
Ok(())
}Structs§
- Bessel
Result Deprecated - Structure representing the result of complex Bessel function calculations
Enums§
- Bessel
Error Deprecated - Error types
Functions§
- Ai
Deprecated - Calculate Airy function Ai(z) (no scaling)
- Ai_
scaled Deprecated - Calculate Airy function Ai(z) with scaling
- Bi
Deprecated - Calculate Airy function Bi(z) (no scaling)
- Bi_
scaled Deprecated - Calculate Airy function Bi(z) with scaling
- I
Deprecated - Calculate modified Bessel function I_ν(z) (single value, no scaling)
- I_
scaled Deprecated - Calculate modified Bessel function I_ν(z) with scaling (single value)
- J
Deprecated - Calculate Bessel function J_ν(z) (single value, no scaling)
- J_
scaled Deprecated - Calculate Bessel function J_ν(z) with scaling (single value)
- K
Deprecated - Calculate modified Bessel function K_ν(z) (single value, no scaling)
- K_
scaled Deprecated - Calculate modified Bessel function K_ν(z) with scaling (single value)
- Y
Deprecated - Calculate Bessel function Y_ν(z) (single value, no scaling)
- Y_
scaled Deprecated - Calculate Bessel function Y_ν(z) with scaling (single value)
- airy_ai
Deprecated - Calculate complex Airy function Ai(z)
- airy_bi
Deprecated - Calculate complex Airy function Bi(z)
- bessel_
i Deprecated - Calculate complex modified Bessel function I_ν(z)
- bessel_
j Deprecated - Calculate complex Bessel function J_ν(z)
- bessel_
k Deprecated - Calculate complex modified Bessel function K_ν(z)
- bessel_
y Deprecated - Calculate complex Bessel function Y_ν(z)
- zairyâš
Deprecated - zbeshâš
Deprecated - zbesiâš
Deprecated - zbesjâš
Deprecated - zbeskâš
Deprecated - zbesyâš
Deprecated - zbiryâš
Deprecated