Skip to content

Instantly share code, notes, and snippets.

@DeflateAwning
Created March 29, 2024 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeflateAwning/2dd0d113518a7311b0fcf70e44a815e1 to your computer and use it in GitHub Desktop.
Save DeflateAwning/2dd0d113518a7311b0fcf70e44a815e1 to your computer and use it in GitHub Desktop.
An example of using Sympy
from sympy import symbols, Eq, solve
# Define symbols
k1, k2, k3 = symbols('incoming_slope normal_slope outgoing_slope')
# Define the equation
equation = Eq((k1 - k2) / (1 + (k1*k2)), (k2 - k3) / (1 + (k2*k3)))
# Solve the equation for k3
solution = solve(equation, k3)
print(solution)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment