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

Question about the physics #1

Open
Pandicon opened this issue Jun 1, 2024 · 0 comments
Open

Question about the physics #1

Pandicon opened this issue Jun 1, 2024 · 0 comments

Comments

@Pandicon
Copy link

Pandicon commented Jun 1, 2024

I've been reading through the code in this repository and have a question about the physics used in the simulation. It seems like the ray deflection is simulated using Newtonian gravitation, but the force is also multiplied by the square of cross(ray_direction, ray_to_black_hole_direction) (and then divided by the square of the distance to the black hole, essentially resulting in the square of the sine of the angle between the two vectors, so it is dimensionally correct). Why do you multiply the force by sin(angle)^2? And it also seems like you use dp = F * dt, add the change in momentum to the current direction, and then normalize it. But this produces different results to adding up all the momentum changes and normalizing it at the end (see the image below, the red vector first adds up all of the grey ones and is then normalized, while the green one is normalized after each addition, the angle between the vectors is about 15°; furthermore, all of these vectors have the same length, the differences could be much greater if some of the vectors were longer than others, see the second image, the angle between those vectors is about 25°). I would think the physically correct result is the one obtained through accumulating the changes and normalizing at the end.
image
image
Thanks for any response! :D

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