7 个版本 (4 个重大变更)
| 0.5.0 | 2024 年 7 月 14 日 | 
|---|---|
| 0.4.0 | 2024 年 7 月 13 日 | 
| 0.3.2 | 2024 年 7 月 10 日 | 
| 0.2.0 | 2024 年 7 月 8 日 | 
| 0.1.0 | 2024 年 7 月 8 日 | 
#43 在 #coordinate
每月 580 次下载
在 2 个包中使用 (通过 coordinate-frame)
57KB
 1K  SLoC
简单的坐标系转换
该包旨在支持不同标准和非标准坐标系之间的简单转换。一个潜在用例是在原型设计 IMU 传感器数据时,可能将多个惯性或场传感器安装在不同方向上。这些可以通过坐标系(例如 EastNorthUp)来表示,并轻松转换为任何你喜欢的基准,例如 NorthEastDown。
示例
use coordinate_frame::{NorthEastDown, NorthEastUp};
fn example() {
    // Construct a coordinate in one reference frame.
    let neu = NorthEastUp::new(1.0, 2.0, 3.0);
    assert_eq!(neu.north(), 1.0);
    assert_eq!(neu.east(), 2.0);
    assert_eq!(neu.up(), 3.0);
    // Note that "non-native" axes are also available.
    assert_eq!(neu.down(), -3.0);
    // You can transform it into a different frame.
    let ned: NorthEastDown<_> = neu.into();
    assert_eq!(ned.north(), 1.0);
    assert_eq!(ned.east(), 2.0);
    assert_eq!(ned.down(), -3.0);
    // Information is available as you'd expect.
    assert_eq!(ned, &[1.0, 2.0, -3.0]);
    assert_eq!(ned.x(), 1.0);
    assert_eq!(ned.z(), -3.0);
}
行为准则
我们遵守 贡献者誓言,并要求您也这样做。
许可协议
版权 © 2024 Markus Mayer
三种许可证任选其一
- 欧洲联盟公共许可证,版本 1.2,(LICENSE-EUPL 或 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
- Apache 许可证,版本 2.0,(LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
- MIT 许可证 (LICENSE-MIT 或 https://open-source.org.cn/licenses/MIT)
依赖关系
~230–670KB
~16K SLoC