Created
December 15, 2016 06:49
-
-
Save Dante83/69485985ee048db57413a62049715631 to your computer and use it in GitHub Desktop.
This file contains 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
rp1 = self.rotated_p1 | |
rp2 = self.rotated_p2 | |
rp3 = self.rotated_p3 | |
alpha_numerator = ((rp2[1] - rp3[1])*(intersection_point[0] - rp3[0]) + (rp3[0] - rp2[0])*(intersection_point[1] - rp3[1])) | |
alpha_denominator = ((rp2[1] - rp3[1])*(rp1[0] - rp3[0]) + (rp3[0] - rp2[0])*(rp1[1] - rp3[1])) | |
alpha = alpha_numerator / alpha_denominator | |
beta_numerator = ((rp3[1] - rp1[1])*(intersection_point[0] - rp3[0]) + (rp1[0] - rp3[0])*(intersection_point[1] - rp3[1])) | |
beta_denominator = ((rp2[1] - rp3[1])*(rp1[0] - rp3[0]) + (rp3[0] - rp2[0])*(rp1[1] - rp3[1])) | |
beta = beta_numerator / beta_denominator | |
gamma = 1.0 - alpha - beta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment