qtty 0.7.1

Strongly typed physical and astronomical quantities.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (C) 2026 Vallés Puig, Ramon

//! Angle helpers example: wrapping and separation in a single unit type.

use qtty::{Arcsecond, Degree};

fn main() {
    let a = Degree::new(370.0).wrap_signed();
    assert_eq!(a.value(), 10.0);

    let s = Degree::new(45.0).abs_separation(Degree::new(350.0));
    assert_eq!(s.value(), 55.0);

    let arcsec: Arcsecond = Degree::new(1.0).to();
    assert_eq!(arcsec.value(), 3600.0);
}