代码拉取完成,页面将自动刷新
#[allow(unused_imports)]
use crate::structure::polynomial::*;
use std::convert::Into;
use std::f64::consts::PI;
pub fn chebyshev_nodes<T>(num: usize, start: T, end: T) -> Vec<f64>
where
T: Into<f64> + Copy,
{
let mut v = vec![0f64; num];
let a = start.into();
let b = end.into();
for i in 0..num {
v[i] = (a + b) / 2. + 0.5 * (b - a) * ((2 * i + 1) as f64 * PI / (2 * num) as f64).cos();
}
return v;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。