Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha and beta calculation in pyTg43 #7

Open
AdnanJafar opened this issue Sep 8, 2024 · 0 comments
Open

Alpha and beta calculation in pyTg43 #7

AdnanJafar opened this issue Sep 8, 2024 · 0 comments

Comments

@AdnanJafar
Copy link

AdnanJafar commented Sep 8, 2024

Hi,
Hope you are doing well. Thanks for sharing this pyTG43 code and it is really helpful. I have a question regarding the calculation of alpha and beta for dwell points. I am just confused whether alpha and beta belong to azimuthal and polar angles for each of those dwell position? If so, why they are calculated like this

    nv = v / r
    cosines = [np.arccos(x) for x in nv]
    alpha = np.arccos(
        (np.cos(cosines[1])) / (np.cos(np.arcsin(-np.cos(cosines[0]))))
    )
    beta = np.arcsin(-np.cos(cosines[0]))

    if abs(np.cos(cosines[2]) - np.sin(alpha) * np.cos(beta)) > 1e-15:
        v = closest[1] - closest[0]
        r = euclidzip(closest[1], closest[0])
        nv = v / r
        cosines = [np.arccos(x) for x in nv]
        alpha = (
            np.arccos(
                (np.cos(cosines[1])) / (np.cos(np.arcsin(-np.cos(cosines[0]))))
            )
            + np.pi
        )
        beta = -np.arcsin(-np.cos(cosines[0]))

I though they are supposed to be calculated using cos-1(z/r) and arctan2(y,x). Could you please comment on it?

Secondly, with my calculation, beta is coming out as both positive and negative angles (if I convert it into degree) that should not between 0 and 180 degrees?

Regards,
Adnan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant