2个版本

0.1.1 2024年2月12日
0.1.0 2024年2月9日

#251 in 图形API

MIT 许可证

84KB
2K SLoC

欢迎使用FerriLab!

此库允许您处理来自物理实验室的数据,在测量之间进行计算并绘制图形。

用法

FerriLab 基于对象 [Measure],用于存储测量的值和误差。为了便于创建新的测量,[measure] 宏允许您以各种格式引入数据。

measure对象实现了测量与数字之间以及处理数据所需的基本数学函数的所有操作。

对测量应用每个操作时,误差将根据误差传播规则进行修改。此外,测量可以近似到误差的第一位有效数字。

use ferrilab::{measure, Measure};
let time = measure!([0.227, 0.312, 0.4019, 0.512], [0.012, 0.023, 0.025, 0.048]);
let position = measure!([2.425, 3.41515, 5.13545, 7.24524], [0.2, 0.43, 0.544, 0.872]; true);
let speed = &position / &time; // Using reference allows position and time to still be used.
let angle_grads = measure!([0, 30, 45, 60, 90, 180], [0.01, 3, 4, 5.8, 7, 11.6]);

let angle_rad = angle_grads.rad(); // Transform grades to radians.
let cosine = angle_rad.cos(); // Calculates the cosine of angles.

依赖项

~3.5–9.5MB
~86K SLoC