def test_parallel_axis(): N = ReferenceFrame('N') m, a, b = symbols('m, a, b') o = Point('o') p = o.locatenew('p', a * N.x + b * N.y) P = Particle('P', o, m) Ip = P.parallel_axis(p, N) Ip_expected = inertia(N, m * b**2, m * a**2, m * (a**2 + b**2), ixy=-m * a * b) assert Ip == Ip_expected
def test_parallel_axis(): N = ReferenceFrame("N") m, a, b = symbols("m, a, b") o = Point("o") p = o.locatenew("p", a * N.x + b * N.y) P = Particle("P", o, m) Ip = P.parallel_axis(p, N) Ip_expected = inertia(N, m * b**2, m * a**2, m * (a**2 + b**2), ixy=-m * a * b) assert Ip == Ip_expected