Finding distance between 2 points in a given list while browing the llist

0

I have a little problem to solve .. i have a array with x, y, z co-ordinates in it as a tuple. I am trying to find the distance between each point and sorting the points according to the min distance. Can soemone help me with the algorithm ??

import cv
from math import floor, sqrt, ceil
from numpy import array, dot, subtract, add, linalg as lin
def calcdist(data):
for p in data:
x = p[:1]
y = p[:2]
z = p[:3]
for i in range(len(data)):
dist = sqrt((x[i]-x[i+1])^2 + (y[i]-y[i+1])^2 +(z[i]-z[i+1]^2))
return dist
def ReadPointCloud(filename):
return [tuple(map(float, l.split()[1:4])) for l in open(filename)]
def main (data):
for i in range(len(data)): # Finding Neighbours
for j in range(len(data)):
dist = calcdist(data)
print dist
if __name__ == '__main__':
data = ReadPointCloud(r'Z:\data\NEHreflectance_Scanner 1_part.txt')
data = data[0:100]
main(data)

Start by printing x, y, and z. And print the return. These are always good places to start.

def calcdist(data):
for p in data:
x = p[:1]
y = p[:2]
z = p[:3]
print "x, y, and z =", x, y, z
for i in range(len(data)):
dist = sqrt((x[i]-x[i+1])^2 + (y[i]-y[i+1])^2 +(z[i]-z[i+1]^2))
print "returning", dist, "for", x, y, z
return dist

Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...

Iam Getting An Error With try to excecute the stored procedure .

I have Have Sql database , the stored procedure like so :

USE [MPRS]
GO
/****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE ...

Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"