So I have a set of positional data that I comes from a factory sensor. It produces x, y and z info in meters from to a known lat/long position. I have a function that will convert the distance in meters from the lat/long but I need to use the x and y data in a Pythagoras function to determine that. Let me try to clarify with an example of the JSON data the sensor gives.

```
[
{
    "id": "84eb18677194",
    "name": "forklift_0001",
    "areaId": "Tracking001",
    "areaName": "Hall1",
    "color": "#FF0000",
    "coordinateSystemId": "CoordSys001",
    "coordinateSystemName": null,
    "covarianceMatrix": [
        0.82,
        -0.07,
        -0.07,
        0.55
    ],
    "position": [ #this is the x,y and z data, in meters from the ref point
        18.11,
        33.48,
        2.15
    ],

```

In this branch the forklift is 18.11m along and 33.38m up from the reference lat/long. The sensor is 2.15m high and that is a constant piece of info i don't need. To work out the distance from the reference point I need to use Pythagoras and then convert that data back into lat/long so my analysis tool can present it.

My problem (as far as python goes) is that I can't figure out how to make it see 18.11 & 33.38 as the x & y and tell it to disregard 2.15 entirely. Here is what i have so far.

```
import math
import json
import pprint
import os
from glob import iglob

rootdir_glob = 'C:/Users/username/Desktop/test_folder**/*"' # Note the 
added asterisks, use forward slash
# This will return absolute paths
file_list = [f for f in 
iglob('C:/Users/username/Desktop/test_folder/13/00**/*', recursive=True) 
if os.path.isfile(f)]

for f in file_list:
    print('Input file: ' + f) # Replace with desired operations

with open(f, 'r') as f:

    distros = json.load(f)
    output_file = 'position_data_blob_14' + str(output_nr) + '.csv' #output file name may be changed

def pythagoras(a,b):
    value = math.sqrt(a*a + b*b)
    return value

result = pythagoras(str(distro['position'])) #I am totally stuck here :/
print(result)

```

This piece of script is part of a wider project to parse the file by machine and people and also by work and non work times of day.

If someone could give me some tips on how to make the pythagorus part work i'd be really grateful. I am not sure if I should define it as a function but as I've typed this I am wondering if it should be a 'for' loop which uses the x & y and ignores the x.

All help really appreciated.