json_atomic 0.1.1

The Cryptographic Atom — JSON✯Atomic: canonicalization + BLAKE3 content addressing + DV25-Seal (Ed25519) for Signed Facts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use json_atomic::trajectory_confidence;

#[test]
fn cosine_identity_and_orthogonal() {
    let a = [1.0, 0.0, 0.0];
    let b = [1.0, 0.0, 0.0];
    let c = [0.0, 1.0, 0.0];

    let id = trajectory_confidence(&a, &b);
    let ort = trajectory_confidence(&a, &c);

    assert!((id - 1.0).abs() < 1e-6);
    assert!((ort - 0.5).abs() < 1e-6);
}