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

HexagonCubic and HexagonAxial inconsistency #19

Open
hsseung opened this issue Aug 13, 2023 · 0 comments
Open

HexagonCubic and HexagonAxial inconsistency #19

hsseung opened this issue Aug 13, 2023 · 0 comments

Comments

@hsseung
Copy link

hsseung commented Aug 13, 2023

According to the cited reference,
HexagonCubic(q, r, s) == HexagonAxial(q, r), but convert isn't consistent about that convention.

julia> convert(HexagonCubic, HexagonAxial(1, 1))
HexagonCubic(1, 1, -2)
julia> convert(HexagonAxial, HexagonCubic(1, 1, -2))
HexagonAxial(1, -2)

vertices follows the second convention that HexagonCubic(q, r, s) == HexagonAxial(q, s), as shown by the examples below.

julia> collect(vertices(HexagonAxial(1, 1)))
6-element Vector{Any}:
 (3.464101615137755, 2.0)
 (2.598076211353316, 2.5)
 (1.7320508075688776, 2.0000000000000004)
 (1.7320508075688772, 1.0000000000000002)
 (2.598076211353316, 0.5)
 (3.4641016151377544, 0.9999999999999996)
julia> collect(vertices(HexagonCubic(1, 1, -2)))
6-element Vector{Any}:
 (0.8660254037844387, -2.5)
 (6.123233995736766e-17, -2.0)
 (-0.8660254037844385, -2.4999999999999996)
 (-0.8660254037844388, -3.4999999999999996)
 (-1.8369701987210297e-16, -4.0)
 (0.8660254037844384, -3.5000000000000004)
julia> collect(vertices(HexagonCubic(1, -2, 1)))
6-element Vector{Any}:
 (3.464101615137755, 2.0)
 (2.598076211353316, 2.5)
 (1.7320508075688776, 2.0000000000000004)
 (1.7320508075688772, 1.0000000000000002)
 (2.598076211353316, 0.5)
 (3.4641016151377544, 0.9999999999999996)
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