def test_alpha_wind():
    dyn = asb.DynamicsRigidBody3DBodyEuler(
        u_b=0,
        w_b=1,
    )
    x, y, z = dyn.convert_axes(0, 0, 1, "geometry", "wind")
    assert x == pytest.approx(-1)
    assert y == pytest.approx(0)
    assert z == pytest.approx(0)
def test_beta_stability_body():
    dyn = asb.DynamicsRigidBody3DBodyEuler(u_b=0, v_b=1
                                           # alpha=0,
                                           # beta=90
                                           )
    x, y, z = dyn.convert_axes(0, 1, 0, "body", "stability")
    assert x == pytest.approx(0)
    assert y == pytest.approx(1)
    assert z == pytest.approx(0)
def test_beta_wind():
    dyn = asb.DynamicsRigidBody3DBodyEuler(
        u_b=0,
        v_b=1,
        # alpha=0,
        # beta=90
    )
    x, y, z = dyn.convert_axes(0, 1, 0, "geometry", "wind")
    assert x == pytest.approx(1)
    assert y == pytest.approx(0)
    assert z == pytest.approx(0)
def test_order_wind_body():
    dyn = asb.DynamicsRigidBody3DBodyEuler(
        u_b=0,
        v_b=1,
        phi=np.pi / 2,
        # alpha=90,
        # beta=90,
    )
    x, y, z = dyn.convert_axes(0, 1, 0, "body", "wind")
    assert x == pytest.approx(1)
    assert y == pytest.approx(0)
    assert z == pytest.approx(0)
import aerosandbox as asb
import aerosandbox.numpy as np
from typing import List
import copy
import pytest

vector = [1, 2, 3]
dyn = asb.DynamicsRigidBody3DBodyEuler(
    x_e=0,
    y_e=0,
    z_e=0,
    u_b=1,
    v_b=0,
    w_b=0,
    phi=0,
    theta=0,
    psi=0,
    p=0,
    q=0,
    r=0,
)


def chain_conversion(axes: List[str] = ["geometry", "body", "geometry"]):
    x, y, z = copy.deepcopy(vector)
    for from_axes, to_axes in zip(axes, axes[1:]):
        x, y, z = dyn.convert_axes(x_from=x,
                                   y_from=y,
                                   z_from=z,
                                   from_axes=from_axes,
                                   to_axes=to_axes)