Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Saxsori authored Nov 9, 2022
1 parent 04929f8 commit 9c54610
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ To calculate the horizontal gridline checker formulas. We can follow these steps

- The ray Y point should be the player's Y coordinate.

- Then to get the ray X point we can use the right triangle rules `(SOHCAHTOA)`. The ray line would be Hypotenuse, the Opposite is the difference between the player Y coordinate and Ray Y point and the Adjacent is the ray X component which we are trying to find. So ray X is `tan(looking angle) / opposite (ray Y)`.
- Then to get the ray X point we can use the right triangle rules `(SOHCAHTOA)`. The ray line would be Hypotenuse, the Opposite is the difference between the player Y coordinate and Ray Y point and the Adjacent is the ray X component which we are trying to find. So ray X is `opposite (ray Y) / tan(looking angle)`.

![alt text](https://github.com/Saxsori/ray-cast/blob/main/images/4.png)

Expand Down

0 comments on commit 9c54610

Please sign in to comment.