I am trying to calculate a resultant acceleration from x, y, z accelerations. I have written a function that does this when manually inputting the x,y,z coordinates.
def Euclidean_norm(x,y,z):
total = (x ** 2) + (y ** 2) + (z ** 2)
resultant = math.sqrt(total)
return resultant
My problem is that I want to use this function to iterate over 3 lists, and produce a new list with only the resultant acceleration.
x_list = [(9.6,), (4.9,), (8.7,), (9.....]
y_list = [(0.6,), (2.6,), (4.6,), (2.....]
z_list = [(5.2,), (7.2,), (5.8,), (7.....]
I have tried to use the map function
print(map(Euclidean_norm(a,b,c)))
However this gave an error
TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'int'
Part of the problem is that the values for x
, y
and z
I get from the database come out as tuples instead of plain numbers.