Skip to content

Instantly share code, notes, and snippets.

@avamsi
Created November 28, 2014 21:58
Show Gist options
  • Save avamsi/d8e57128782c26333b34 to your computer and use it in GitHub Desktop.
Save avamsi/d8e57128782c26333b34 to your computer and use it in GitHub Desktop.
from math import sqrt
for _ in xrange(int(raw_input())):
u, v, w, w1, v1, u1 = map(int, raw_input().split())
u2 = v**2 + w**2 - u1**2
v2 = w**2 + u**2 - v1**2
w2 = u**2 + v**2 - w1**2
vol = sqrt(4 * u**2 * v**2 * w**2 - u**2 * u2**2 - v**2 * v2**2 - w**2 * w2**2 + u2 * v2 * w2) / 12
print round(vol, 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment