<commit_before>use nalgebra::*;

/// #Central body
/// It holds standard gravitational parameter (product of body's mass and the gravitational constant)
/// and a local coordinate system associated with this body.
pub struct CB {
    /// Standard gravitational parameter.
    pub mu: f64,
    /// A unit vector pointing towards
    /// the intersection of 0th meridian and equator.
    pub i: Vec3<f64>,
    /// j = cross(&k, &i)
    pub j: Vec3<f64>,
    /// A unit vector pointing towards the north pole.
    pub k: Vec3<f64>,
}

impl CB {
    /// Create a new central body asserting that i, j, k compose an orthonormal right-handed vector basis.
    pub fn new(mu: f64, i: Vec3<f64>, j: Vec3<f64>, k: Vec3<f64>) -> CB {
        assert!(approx_eq(&dot(&i, &j), &0.0));
        assert!(approx_eq(&dot(&i, &k), &0.0));
        assert!(approx_eq(&dot(&j, &k), &0.0));
        assert!(approx_eq(&norm(&i), &1.0));
        assert!(approx_eq(&norm(&j), &1.0));
        assert!(approx_eq(&norm(&k), &1.0));
        assert!(approx_eq(&cross(&i, &j), &k));
        CB {
            mu: mu,
            i: i,
            j: j,
            k: k,
        }
    }

    /// Find what value does a given vector has in the coordinate system associated with a different central body.
    pub fn change_cb(&self, vec: Vec3<f64>, other: CB) -> Vec3<f64> {
        other.i * dot(&vec, &self.i) +
        other.j * dot(&vec, &self.j) +
        other.k * dot(&vec, &self.k)
    }
}
<commit_msg>Remove change_cb method from CB<commit_after>use nalgebra::*;

/// #Central body
/// It holds standard gravitational parameter (product of body's mass and the gravitational constant)
/// and a local coordinate system associated with this body.
pub struct CB {
    /// Standard gravitational parameter.
    pub mu: f64,
    /// A unit vector pointing towards
    /// the intersection of 0th meridian and equator.
    pub i: Vec3<f64>,
    /// j = cross(&k, &i)
    pub j: Vec3<f64>,
    /// A unit vector pointing towards the north pole.
    pub k: Vec3<f64>,
}

impl CB {
    /// Create a new central body asserting that i, j, k compose an orthonormal right-handed vector basis.
    pub fn new(mu: f64, i: Vec3<f64>, j: Vec3<f64>, k: Vec3<f64>) -> CB {
        assert!(approx_eq(&dot(&i, &j), &0.0));
        assert!(approx_eq(&dot(&i, &k), &0.0));
        assert!(approx_eq(&dot(&j, &k), &0.0));
        assert!(approx_eq(&norm(&i), &1.0));
        assert!(approx_eq(&norm(&j), &1.0));
        assert!(approx_eq(&norm(&k), &1.0));
        assert!(approx_eq(&cross(&i, &j), &k));
        CB {
            mu: mu,
            i: i,
            j: j,
            k: k,
        }
    }
}

{'fraction_non_alphanumeric': 0.16509966152688982, 'fraction_numerical': 0.0285821737495299, 'mean_word_length': 2.320848938826467, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1818029', 'n_tokens_mistral': 918, 'n_tokens_neox': 876, 'n_words': 285}