from misc import centroid
import copy

__somar = [ [],[],[],[],]
__somar[0] += [ [13.33, 8.91, -0.69, 0.21] ]
__somar[0] += [ [9.5, 6.61, -0.49, 0.21] ]
__somar[0] += [ [9.49, 6.4, -0.51, 0.21] ]
__somar[0] += [ [8.46, 2.92, -0.77, 0.21] ]
__somar[0] += [ [5.07, 1.02, -0.58, 0.21] ]
__somar[0] += [ [5.04, 0.82, -0.6, 0.21] ]
__somar[0] += [ [4.28, -1.6, -0.78, 0.21] ]
__somar[0] += [ [-1.07, -1.57, -0.15, 0.21] ]
__somar[0] += [ [-1.48, -1.55, -0.1, 0.21] ]
__somar[0] += [ [-4.73, -3.89, 0.03, 0.21] ]
__somar[0] += [ [-7.15, -2.95, 0.41, 0.21] ]
__somar[0] += [ [-7.73, -2.7, 0.51, 0.21] ]
__somar[0] += [ [-11.36, -1.5, 1.06, 0.21] ]
__somar[0] += [ [-11.95, -0.66, 1.22, 0.21] ]
__somar[0] += [ [-16.14, 1.2, 1.92, 0.21] ]
__somar[0] += [ [-18.9727, 8.80905, 3.07801, 4.87683] ]
__somar[0] += [ [-17.5043, 9.44789, 2.97622, 6.0119] ]
__somar[0] += [ [-16.0358, 10.0867, 2.87443, 5.85506] ]
__somar[0] += [ [-14.5674, 10.7256, 2.77263, 5.51484] ]
__somar[0] += [ [-13.0989, 11.3644, 2.67084, 6.26127] ]
__somar[0] += [ [-11.6305, 12.0033, 2.56905, 15.9768] ]
__somar[0] += [ [-10.162, 12.6421, 2.46726, 17.7149] ]
__somar[0] += [ [-8.69356, 13.2809, 2.36547, 17.9458] ]
__somar[0] += [ [-7.22511, 13.9198, 2.26368, 17.769] ]
__somar[0] += [ [-5.75666, 14.5586, 2.16188, 16.7679] ]
__somar[0] += [ [-4.2882, 15.1975, 2.06009, 18.0441] ]
__somar[0] += [ [-2.81975, 15.8363, 1.9583, 17.8756] ]
__somar[0] += [ [-1.35129, 16.4752, 1.85651, 17.3578] ]
__somar[0] += [ [0.11716, 17.114, 1.75472, 17.1265] ]
__somar[0] += [ [1.58561, 17.7528, 1.65292, 16.7555] ]
__somar[0] += [ [3.05407, 18.3917, 1.55113, 15.983] ]
__somar[0] += [ [4.52252, 19.0305, 1.44934, 15.6683] ]
__somar[0] += [ [5.99098, 19.6694, 1.34755, 16.0541] ]
__somar[0] += [ [7.45943, 20.3082, 1.24576, 14.798] ]
__somar[0] += [ [8.92788, 20.9471, 1.14397, 11.2467] ]
__somar[0] += [ [10.3963, 21.5859, 1.04217, 6.22061] ]
__somar[1] += [ [9.92, -87.81, -14, 3.3] ]
__somar[1] += [ [8.59, -91.39, -14, 4.77] ]
__somar[1] += [ [10.7447, -93.2176, -14, 0.84097] ]
__somar[1] += [ [11.6386, -92.3731, -14, 1.15201] ]
__somar[1] += [ [12.5326, -91.5287, -14, 1.7741] ]
__somar[1] += [ [13.4265, -90.6842, -14, 2.39618] ]
__somar[1] += [ [14.3205, -89.8397, -14, 3.01827] ]
__somar[1] += [ [15.2144, -88.9952, -14, 3.64035] ]
__somar[1] += [ [16.1084, -88.1508, -14, 4.26244] ]
__somar[1] += [ [17.0024, -87.3063, -14, 4.74329] ]
__somar[1] += [ [17.8963, -86.4618, -14, 5.00818] ]
__somar[1] += [ [18.7903, -85.6173, -14, 5.27308] ]
__somar[1] += [ [19.6842, -84.7729, -14, 5.25493] ]
__somar[1] += [ [20.5782, -83.9284, -14, 5.20361] ]
__somar[1] += [ [21.4721, -83.0839, -14, 5.15229] ]
__somar[1] += [ [22.3661, -82.2394, -14, 5.10097] ]
__somar[1] += [ [23.26, -81.395, -14, 5.04964] ]
__somar[1] += [ [24.154, -80.5505, -14, 4.63405] ]
__somar[1] += [ [25.0479, -79.706, -14, 3.81938] ]
__somar[1] += [ [25.9419, -78.8615, -14, 2.92382] ]
__somar[1] += [ [26.8358, -78.0171, -14, 2.02827] ]
__somar[1] += [ [27.7298, -77.1726, -14, 1.13271] ]
__somar[1] += [ [28.6237, -76.3281, -14, 0.684916] ]
__somar[2] += [ [14.45, -12.9, -5, 0.18] ]
__somar[2] += [ [1.28, -30.36, -5, 0.18] ]
__somar[2] += [ [1.11, -30.3, -5, 0.18] ]
__somar[2] += [ [-6.37, -35.14, -5, 0.18] ]
__somar[2] += [ [-14.66, -36.94, -5, 0.18] ]
__somar[2] += [ [-19.59, -36.49, -5, 0.18] ]
__somar[2] += [ [-23.3333, -30.8163, -5, 2.62829] ]
__somar[2] += [ [-21.6195, -29.702, -5, 4.75224] ]
__somar[2] += [ [-19.9056, -28.5878, -5, 5.89521] ]
__somar[2] += [ [-18.1918, -27.4735, -5, 7.03818] ]
__somar[2] += [ [-16.4779, -26.3592, -5, 7.8037] ]
__somar[2] += [ [-14.7641, -25.245, -5, 8.26718] ]
__somar[2] += [ [-13.0502, -24.1307, -5, 8.71423] ]
__somar[2] += [ [-11.3364, -23.0165, -5, 8.10126] ]
__somar[2] += [ [-9.62252, -21.9022, -5, 7.39811] ]
__somar[2] += [ [-7.90868, -20.7879, -5, 6.69496] ]
__somar[2] += [ [-6.19483, -19.6737, -5, 5.99181] ]
__somar[2] += [ [-4.48098, -18.5594, -5, 5.31514] ]
__somar[2] += [ [-2.76713, -17.4452, -5, 4.80464] ]
__somar[2] += [ [-1.05328, -16.3309, -5, 4.29632] ]
__somar[2] += [ [0.660568, -15.2166, -5, 3.788] ]
__somar[2] += [ [2.37442, -14.1024, -5, 3.27968] ]
__somar[2] += [ [4.08827, -12.9881, -5, 2.77135] ]
__somar[2] += [ [5.80211, -11.8739, -5, 2.26303] ]
__somar[2] += [ [7.51596, -10.7596, -5, 1.60971] ]
__somar[2] += [ [9.22981, -9.64535, -5, 0.886462] ]
__somar[2] += [ [10.9437, -8.53109, -5, 0.524838] ]
__somar[3] += [ [12.93, -83.22, 49.06, 0.37] ]
__somar[3] += [ [3.85, -88.03, 48.15, 0.37] ]
__somar[3] += [ [-3.86, -90.4, 47.71, 0.37] ]
__somar[3] += [ [-10.88, -93.32, 47.15, 0.37] ]
__somar[3] += [ [-11.25, -93.27, 47.17, 0.37] ]
__somar[3] += [ [-18.85, -94.75, 46.89, 0.37] ]
__somar[3] += [ [-18.85, -94.75, 46.89, 0.37] ]
__somar[3] += [ [-22.51, -94.2, 47, 0.37] ]
__somar[3] += [ [-22.88, -94.15, 47, 0.37] ]
__somar[3] += [ [-24.93, -92.49, 47.32, 0.37] ]
__somar[3] += [ [-24.93, -92.49, 47.32, 0.37] ]
__somar[3] += [ [-24.7, -90.31, 47.72, 0.37] ]
__somar[3] += [ [-24.6171, -88.4133, 48.0805, 3.15239] ]
__somar[3] += [ [-22.5858, -87.9324, 48.1706, 3.14197] ]
__somar[3] += [ [-20.5545, -87.4515, 48.2607, 3.68995] ]
__somar[3] += [ [-18.5233, -86.9706, 48.3509, 4.20322] ]
__somar[3] += [ [-16.492, -86.4897, 48.441, 4.57388] ]
__somar[3] += [ [-14.4607, -86.0088, 48.5311, 5.04288] ]
__somar[3] += [ [-12.4294, -85.5279, 48.6213, 5.98046] ]
__somar[3] += [ [-10.3981, -85.047, 48.7114, 5.89961] ]
__somar[3] += [ [-8.36679, -84.5661, 48.8015, 6.118] ]
__somar[3] += [ [-6.3355, -84.0851, 48.8916, 6.47644] ]
__somar[3] += [ [-4.30421, -83.6042, 48.9818, 6.7991] ]
__somar[3] += [ [-2.27291, -83.1233, 49.0719, 6.81689] ]
__somar[3] += [ [-0.241622, -82.6424, 49.162, 6.88936] ]
__somar[3] += [ [1.78967, -82.1615, 49.2522, 6.96184] ]
__somar[3] += [ [3.82096, -81.6806, 49.3423, 6.81986] ]
__somar[3] += [ [5.85226, -81.1997, 49.4324, 6.36703] ]
__somar[3] += [ [7.88355, -80.7188, 49.5226, 5.99956] ]
__somar[3] += [ [9.91484, -80.2379, 49.6127, 6.109] ]
__somar[3] += [ [11.9461, -79.757, 49.7028, 5.76214] ]
__somar[3] += [ [13.9774, -79.2761, 49.7929, 4.94275] ]
__somar[3] += [ [16.0087, -78.7952, 49.8831, 2.77666] ]


N_SOMA = len(__somar)

def realSoma(i, p):
    soma1 = copy.deepcopy(__somar[i])

    # translation vector calculation
    vec = centroid(soma1)
    for j in range(3): vec[j] = p[j] - vec[j]
    
    # translate
    for x in soma1:
        for j in range(3):
            x[j] += vec[j]

    return soma1