Created
June 30, 2017 14:11
-
-
Save IKKO-Ohta/613456ef3804e50c274dd453e6689d48 to your computer and use it in GitHub Desktop.
ABC02[C].py
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
import math | |
import numpy as np | |
nums = [int(x) for x in input().split()] | |
A = (nums[0],nums[1]) | |
B = (nums[2],nums[3]) | |
C = (nums[4],nums[5]) | |
alpha = np.asarray([B[0] - A[0], B[1] - A[1]]) | |
beta = np.asarray([C[0] - A[0], C[1] - A[1]]) | |
S = 0.5 * math.sqrt( | |
np.linalg.norm(alpha) ** 2 * np.linalg.norm(beta) ** 2 - alpha.dot(beta) ** 2 | |
) | |
print(S) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment