Created
November 13, 2014 05:38
-
-
Save woniesong92/c7f79c812f1ae8be21f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
#x1 = X1 = midpt1.x | |
#x2 = X2 = midpt2.x | |
def getT(x, x1, x2): | |
x0 = 0.0 # origin | |
out1 = ((2.0 * x0 - x1) + sqrt(((-2.0 * x0 + x1) ** 2.0) - ((4 * (x0 - 2.0 * x1 + x2)) * (x0 - x)))) / (2.0 * (x0 - 2.0 * x1 + x2)) | |
out2 = ((2.0 * x0 - x1) - sqrt(((-2.0 * x0 + x1) ** 2.0) - ((4 * (x0 - 2.0 * x1 + x2)) * (x0 - x)))) / (2.0 * (x0 - 2.0 * x1 + x2)) | |
return (out1, out2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment