Skip to content

Instantly share code, notes, and snippets.

@pertsevds
Created April 17, 2021 15:42
Show Gist options
  • Save pertsevds/745ba6e46dd321b68a26fe4a07406b8c to your computer and use it in GitHub Desktop.
Save pertsevds/745ba6e46dd321b68a26fe4a07406b8c to your computer and use it in GitHub Desktop.
Calculate the angle of the ball bouncing from the wall
namespace Billiards
{
public static class BilliardsTask
{
/// <summary>
///
/// </summary>
/// <param name="directionRadians">Угол направления движения шара</param>
/// <param name="wallInclinationRadians">Угол</param>
/// <returns></returns>
public static double BounceWall(double directionRadians, double wallInclinationRadians)
{
return (2 * wallInclinationRadians) - directionRadians;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment