Try using the norm function from numpy.linalg
d = norm(np.cross(p2-p1, p1-p3))/norm(p2-p1)
More Related Contents:
- How do I read CSV data into a record array in NumPy?
- Working with big data in python and numpy, not enough ram, how to save partial results on disc?
- numpy matrix vector multiplication [duplicate]
- Python out of memory on large CSV file (numpy)
- python numpy/scipy curve fitting
- Multiple linear regression in Python
- Plotting a fast Fourier transform in Python
- How to create a density plot in matplotlib?
- How to do n-D distance and nearest neighbor calculations on numpy arrays
- matplotlib – extracting data from contour lines
- Fitting a Normal distribution to 1D data
- Populate a Pandas SparseDataFrame from a SciPy Sparse Matrix
- Installing NumPy and SciPy on 64-bit Windows (with Pip)
- How to extend an array in-place in Numpy?
- Interpolation over an irregular grid
- fitting exponential decay with no initial guessing
- Overflow Error in Python’s numpy.exp function
- How to plot line (polygonal chain) with numpy/scipy/matplotlib with minimal smoothing
- Storing numpy sparse matrix in HDF5 (PyTables)
- How do I use numpy.where()? What should I pass, and what does the result mean? [closed]
- Creating a Confidence Ellipsis in a scatterplot using matplotlib
- Load just part of an image in python
- generalized cumulative functions in NumPy/SciPy?
- Vectorized spatial distance in python using numpy
- Principal component analysis in Python
- Parse a Pandas column to Datetime when importing table from SQL database and filtering rows by date
- Numpy transpose of 1D array not giving expected result
- Concatenating column vectors using numpy arrays
- Fit mixture of two gaussian/normal distributions to a histogram from one set of data, python
- Speedup scipy griddata for multiple interpolations between two irregular grids