use crate::{duration::Duration, prelude::*, speed::Speed};
#[quantity(Speed / Duration)]
#[ref_unit(
Meter_per_Second_squared,
"m/s²",
NONE,
"Reference unit of quantity `Acceleration`"
)]
#[unit(Yards_per_Second_squared, "yd/s²", 0.9144, "yd/s²")]
pub struct Acceleration {}
#[cfg(test)]
mod tests {
use super::*;
use crate::{
assert_almost_eq, duration::MILLISECOND, speed::METER_PER_SECOND,
};
#[test]
fn test_speed_div_duration() {
let av: AmountT = Amnt!(2.94);
let v = av * METER_PER_SECOND;
let at = Amnt!(7.);
let t = at * MILLISECOND;
let a = v / t;
assert_almost_eq!(a.amount(), av / at * Amnt!(1000.));
assert_eq!(a.unit(), METER_PER_SECOND_SQUARED);
}
}