1 Star 0 Fork 0

yutiansut / Peroxide

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
interp.rs 440 Bytes
一键复制 编辑 原始数据 按行查看 历史
Axect 提交于 2020-06-01 19:11 . Huge doc update
#[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;
}
1
https://gitee.com/yutiansut/Peroxide.git
git@gitee.com:yutiansut/Peroxide.git
yutiansut
Peroxide
Peroxide
master

搜索帮助