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

Is the math of calc_vector function right? #22

Open
FabricioMatos opened this issue Jan 28, 2019 · 1 comment
Open

Is the math of calc_vector function right? #22

FabricioMatos opened this issue Jan 28, 2019 · 1 comment

Comments

@FabricioMatos
Copy link

https://github.com/dieegom/brumadinho_location/blob/a252f2de7727c90026db38c4a25511abfb067bed/backend/utils.py#L29

I don't know what is the expected result of this function, but it's returning: (2 * self.lat - barragem.lat), (2 * self.lng - barragem.lng) as we can see:

    def calc_vector(self):
        v_pos_x, v_pos_y = (self.lat - barragem[0], self.lng - barragem[1])
        d = np.sqrt((v_pos_x ** 2 + v_pos_y ** 2))
        print(v_pos_x, v_pos_y, d)
        xf = self.lat + v_pos_x
        yf = self.lng + v_pos_y
        return xf, yf

I couldn't follow the reasoning here.

@RodriguesCSI
Copy link

As long as I understood of the code, it first calculate the Euclidean distance and then it does a translation from the self location to a new one. In the cartesian plane result with a line with 3 points, where the self position encounters in the middle of the others 2. The function returns the translated position.

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

2 participants