
Shortest Distance Between Two Lines in N dimensions 1.0 File ID: 86551 


 Shortest Distance Between Two Lines in N dimensions 1.0 License: Shareware File Size: 10.0 KB Downloads: 15
Submit Rating: 



Shortest Distance Between Two Lines in N dimensions 1.0 Description 

Description: Function uses algorithm from Dan Sunday internet site http://softsurfer.com/Archive/algorithm_01...ment_to_Segment L1, L2 includes two points in matrix of 2*n where n are dimensions (3 in 3D). d  shortest distance between two lines Pc,Qc  points where exists shortest distance d
EXAMPLE: L1=rand(2,3); L2=rand(2,3); [d Pc Qc]=distBW2lines(L1,L2)
Functions of lines L1,L2 and shortest distance line can be plotted in 3d or with minor change in 2D by removing comments sign from code at the end of the file. In some cases points Pc,Qc will not displayed accurately on line. Just change value of par parameter according to point.
Programmed by Alexander Brodsky newshurik at yahoo.com
License: Shareware Related: filein, cases, displayed, Comments, byremoving, plotted, minor, Change, accurately, linejust, Alexander, brodskynewshurik, yahoocom, pointprogrammed, Parameter, linecan, Lines, points O/S:BSD, Linux, Solaris, Mac OS X File Size: 10.0 KB Downloads: 15


More Similar Code 

Computes the shortest distance between two line segments given start and end points for each. Adapts the algorithm found on Dan Sunday's website (http://softsurfer.com/Archive/algorithm_01...ment_to_Segment ).
Usage: Input the start and end x,y,z coordinates for two line segments. p1, p2 are [x,y,z] coordinates of first line segment and p3,p4 are for second line segment.
Output: scalar minimum distance...
This function will compute the great circle distance between two points on a sphere of uniform radius using the Vincenty formula. At minimum, four inputs are required: lat1, long1, lat2, long2. Optionally, a fifth parameter (r) can be specified....
This program calculates the distance between two locations (latitude and longitude) using the Haversine formula. The Haversine formula gives the shortest distance between two points over the earth's surface, ignoring elevation, hills, etc...
This function computes the minimum euclidean distance between two polygons P1 & P2.
 for vertexvertex case
Takes the list of coordinates between 2 groups of pixels and calculates the shortest distance between the 2 groups and returns their pixel coordinates.
Geozip Calc Distance Between Zip Codes is Unix compatible. Calculates distance between zip codes in the US or finds zip codes within a given distance. The subroutines included can be used to calculate distance between latitude and longitude...
Mfile to calculate the distance between two points on the earth surface, using different ellipsoid parameters.
These files show how MATLAB can be used to simulate random walks both on a lattice in Ndimensions and on a graph. The zip file contains the following:
RandDir: generates a random basis vector on a lattice RandGraphMove: Given a...
Vincenty published an algorithm for calculating the distance between two latitudes and longitudes and another to find the destination latitude and longitude, given the start coordinate, bearing and distance
This script calculates distance between two US zip codes. Included subroutines can be used to calculate any distance between latitude and longitude coordinates. The calculation accounts for the fact that the earth is not a perfect sphere. 
User Review for Shortest Distance Between Two Lines in N dimensions 
