ManimCommunity / ManimCommunity/manim

LinearTransformationScene: wrong scaling in self.plane.p2c()

Open
#3,122 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior
Manim 0.17.2

The method self.plane.point_to_coords() returns wrong values.

## Expected behavior
The following script places a Dot() on the position (1,1) of both the background numberplane and the transformed numberplane. Reading back the respective coordinates from the dots' Dot().get_center() results in wrong values for the transformed numberplane.

The background numberplane correctly returns (1,1)

The transformed numberplane returns (1.5547002, 1.5547002)

## How to reproduce the issue
Code for reproducing the problem

```py
class c(LinearTransformationScene):

def __init__(self):
LinearTransformationScene.__init__(self, show_coordinates=True,
i_hat_color= GREEN,
j_hat_color=RED,
include_background_plane= True)

def construct(self):
matrix = [[1,2/np.sqrt(13)], [0, 3/np.sqrt(13)]]

self.apply_matrix(matrix)

dot1=Dot().set_color(GREEN).move_to(self.background_plane.c2p(1,1))
dot2=Dot().set_color(RED).move_to(self.plane.c2p(1,1))
self.add(dot1)
self.add(dot2)
print(self.background_plane.p2c(dot1.get_center()))
print(self.plane.p2c(dot2.get_center()))
self.wait()
```

## Additional media files

Images/GIFs

## Logs
Terminal output

```
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR
```

## System specifications

System Details

- OS Windows 10 64 bit
- Python version 3.9.8

Contributor guide

Open the contributing guide

Research direction

Run the provided reproduction with LinearTransformationScene and compare background_plane.p2c() with plane.p2c() after apply_matrix(). Trace the plane coordinate conversion used by self.plane.p2c() and point_to_coords(); done means the transformed plane returns (1, 1) for the dot placed at transformed coordinates without breaking the background plane behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.