Trait rgsl::trigonometric::Trigonometric
source · pub trait Trigonometric {
Show 23 methods
// Required methods
fn sin(&self) -> Self;
fn sin_e(&self) -> Result<Result, Value>;
fn cos(&self) -> Self;
fn cos_e(&self) -> Result<Result, Value>;
fn sf_hypot(&self, y: f64) -> Self;
fn sf_hypot_e(&self, y: f64) -> Result<Result, Value>;
fn sinc(&self) -> Self;
fn sinc_e(&self) -> Result<Result, Value>;
fn complex_sin_e(&self, zi: f64) -> Result<(Result, Result), Value>;
fn complex_cos_e(&self, zi: f64) -> Result<(Result, Result), Value>;
fn complex_logsin_e(&self, zi: f64) -> Result<(Result, Result), Value>;
fn lnsinh(&self) -> Self;
fn lnsinh_e(&self) -> Result<Result, Value>;
fn lncosh(&self) -> Self;
fn lncosh_e(&self) -> Result<Result, Value>;
fn polar_to_rect(&self, theta: f64) -> Result<(Result, Result), Value>;
fn rect_to_polar(&self, y: f64) -> Result<(Result, Result), Value>;
fn angle_restrict_symm(&self) -> Self;
fn angle_restrict_symm_e(&mut self) -> Result<(), Value>;
fn angle_restrict_pos(&self) -> Self;
fn angle_restrict_pos_e(&mut self) -> Result<(), Value>;
fn sin_err_e(&self, dx: f64) -> Result<Result, Value>;
fn cos_err_e(&self, dx: f64) -> Result<Result, Value>;
}
Required Methods§
sourcefn sf_hypot(&self, y: f64) -> Self
fn sf_hypot(&self, y: f64) -> Self
This routine computes the hypotenuse function \sqrt{x^2 + y^2} avoiding overflow and underflow.
sourcefn sf_hypot_e(&self, y: f64) -> Result<Result, Value>
fn sf_hypot_e(&self, y: f64) -> Result<Result, Value>
This routine computes the hypotenuse function \sqrt{x^2 + y^2} avoiding overflow and underflow.
sourcefn sinc(&self) -> Self
fn sinc(&self) -> Self
This routine computes \sinc(x) = \sin(\pi x) / (\pi x) for any value of x.
sourcefn sinc_e(&self) -> Result<Result, Value>
fn sinc_e(&self) -> Result<Result, Value>
This routine computes \sinc(x) = \sin(\pi x) / (\pi x) for any value of x.
sourcefn complex_sin_e(&self, zi: f64) -> Result<(Result, Result), Value>
fn complex_sin_e(&self, zi: f64) -> Result<(Result, Result), Value>
This function computes the complex sine, \sin(z_r + i z_i) storing the real and imaginary parts in szr, szi.
sourcefn complex_cos_e(&self, zi: f64) -> Result<(Result, Result), Value>
fn complex_cos_e(&self, zi: f64) -> Result<(Result, Result), Value>
This function computes the complex cosine, \cos(z_r + i z_i) storing the real and imaginary parts in czr, czi.
sourcefn complex_logsin_e(&self, zi: f64) -> Result<(Result, Result), Value>
fn complex_logsin_e(&self, zi: f64) -> Result<(Result, Result), Value>
This function computes the logarithm of the complex sine, \log(\sin(z_r + i z_i)) storing the real and imaginary parts in lszr, lszi.
sourcefn polar_to_rect(&self, theta: f64) -> Result<(Result, Result), Value>
fn polar_to_rect(&self, theta: f64) -> Result<(Result, Result), Value>
This function converts the polar coordinates (r,theta) to rectilinear coordinates (x,y), x = r\cos(\theta), y = r\sin(\theta).
sourcefn rect_to_polar(&self, y: f64) -> Result<(Result, Result), Value>
fn rect_to_polar(&self, y: f64) -> Result<(Result, Result), Value>
This function converts the rectilinear coordinates (x,y) to polar coordinates (r,theta), such that x = r\cos(\theta), y = r\sin(\theta). The argument theta lies in the range [-\pi, \pi].
sourcefn angle_restrict_symm(&self) -> Self
fn angle_restrict_symm(&self) -> Self
This routine forces the angle theta to lie in the range (-\pi,\pi].
Note that the mathematical value of \pi is slightly greater than M_PI, so the machine numbers M_PI and -M_PI are included in the range.
sourcefn angle_restrict_symm_e(&mut self) -> Result<(), Value>
fn angle_restrict_symm_e(&mut self) -> Result<(), Value>
This routine forces the angle theta to lie in the range (-\pi,\pi].
Note that the mathematical value of \pi is slightly greater than M_PI, so the machine numbers M_PI and -M_PI are included in the range.
sourcefn angle_restrict_pos(&self) -> Self
fn angle_restrict_pos(&self) -> Self
This routine forces the angle theta to lie in the range [0, 2\pi).
Note that the mathematical value of 2\pi is slightly greater than 2M_PI, so the machine number 2M_PI is included in the range.
sourcefn angle_restrict_pos_e(&mut self) -> Result<(), Value>
fn angle_restrict_pos_e(&mut self) -> Result<(), Value>
This routine forces the angle theta to lie in the range [0, 2\pi).
Note that the mathematical value of 2\pi is slightly greater than 2M_PI, so the machine number 2M_PI is included in the range.