-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
help wantedWe would appreciate help on this issue/PRWe would appreciate help on this issue/PR
Description
Description of bug / unexpected behavior
According to the documentation, the argument of .c2p() may be individual values for x, y (and z), as well as lists, lists of lists and numpy.arrays. However, when using just lists [x,y,z] or 1D np.arrays the returned coordinates are wrong.
Expected behavior
How to reproduce the issue
Code for reproducing the problem
class testc2p(Scene):
def construct(self):
ax = Axes()
print("ax.c2p(1,2) = ",ax.c2p(1,2))
print("ax.c2p(1,2,1) = ",ax.c2p(1,2,1))
print("ax.c2p(np.array([1,2])) = ",ax.c2p(np.array([1,2])))
print("ax.c2p(np.array([1,2,1])) = ",ax.c2p(np.array([1,2,1])))
print("ax.c2p([1,2,1]) = ",ax.c2p([1,2,1]))
print("ax.c2p([1,2]) = ",ax.c2p([1,2]))
print("ax.c2p([[1,2],[2,3]]) = ",ax.c2p([[1,2],[2,3]]))returns
Manim Community v0.18.1
ax.c2p(1,2) = [0.85714286 1.5 0. ]
ax.c2p(1,2,1) = [0.85714286 1.5 0. ]
ax.c2p(np.array([1,2])) = [[0.85714286 1.71428571]
[0. 0. ]
[0. 0. ]]
ax.c2p(np.array([1,2,1])) = [[0.85714286 1.71428571 0.85714286]
[0. 0. 0. ]
[0. 0. 0. ]]
ax.c2p([1,2,1]) = [[0.85714286 1.71428571 0.85714286]
[0. 0. 0. ]
[0. 0. 0. ]]
ax.c2p([1,2]) = [[0.85714286 1.71428571]
[0. 0. ]
[0. 0. ]]
ax.c2p([[1,2],[2,3]]) = [[0.85714286 1.5 0. ]
[1.71428571 2.25 0. ]]
ax.c2p(1,2)andax.c2p(1,2,1)return reasonable valuesax.c2p(np.array([1,2]))appears to be treated as two "points" withx=1andx=2respectively, returning[[x1, x2],[y1, y2],[z1, z2]]rather than[[x1 y1 z1],[x2, y2, z2]], similar for all other 1D-listsax.c2p([[1,2],[2,3]])appears to correctly return two points
System specifications
System Details
- OS : Windows 10
- RAM: enough
- Python version (
python/py/python3 --version): 3.11.6
Metadata
Metadata
Assignees
Labels
help wantedWe would appreciate help on this issue/PRWe would appreciate help on this issue/PR