Tetrahedral Shadows

Problem #52

Tags: geometry puzzle

Who solved this?

Previous:Methane Normalization Next:Min and Max Regular Tetrahedral Shadows


Imagine a stationary opaque tetrahedron which is suspended from a glass ceiling. At noon the sun shines directly downwards, and the tetrahedron casts a shadow onto the floor below.

Given 4 xyz coordinates corresponding to the vertices of a tetrahedron, calculate the area of the shadow cast by that tetrahedron.
Assume all rays of light travel directly downwards, all parallel to each other.

Problem Statement

Input data will contain the number of testcases T in the first line.
The following T lines consist of 12 space-separated decimal values corresponding to XYZ coordinates of the vertices of a tetrahedron, given in the format x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4.

Answer should be a string of T space-separated values corresponding to the area of the shadow cast by the corresponding tetrahedra.
Round all answers to the nearest integer.

Example:

(Indents indicate line breaks for ease of legibility for this example.
Each actual testcase will be given as a single line of 12 values.)

input data:
3
-510.134842 -321.599931 -376.903097
    -554.797813 -237.69143 -312.869955
    -557.183259 -313.151736 -331.771654
    -416.131227 -336.049727 -482.451894
427.493623 -299.214554 -200.883452
    309.793852 -336.763036 -255.088698
    348.122181 -237.773501 -336.866923
    281.012484 -233.115684 -191.544545
-415.268144 -165.722105 -210.016587
    -372.878841 -170.513449 -382.825316
    -510.88644 -265.292058 -322.380427
    -521.299032 -87.757988 -329.856956

answer:
5406 6640 12744
You need to login to get test data and submit solution.