f



Closest Points between two line segments

Found the solution proposed by D. Eberly, found also 2 or 3 other versions 
on the Internet.

All seem to revert to some form of constrained minimization.

Asking two things:
1) why not set up the problem and fire a constrained minimization routine;
2) would not be possible to solve the problem for the lines supporting the 
segments, then check whether or not the closest points fall within segment 
boundaries, if not, compute distance between the segment vertices and select 
the closest points ?

Thanks in advance for your reply

Gigi
0
GianLuigi
2/24/2016 10:55:23 AM
comp.graphics.algorithms 6674 articles. 1 followers. Post Follow

2 Replies
601 Views

Similar Articles

[PageSpeed] 58

Could you post the full problem ?
0
kongp
2/25/2016 6:35:05 AM
kongp wrote:

> Could you post the full problem ?
google segment segment distance

Gigi
0
GianLuigi
2/25/2016 6:49:36 PM
Reply:

Similar Artilces:

closest points on two line segments
Does any one have a fast algorithm for this? Thanks in advance. On 30 Jun 2004 12:38:28 -0700, jtreepeace@yahoo.com (HLSL fan) wrote: >Does any one have a fast algorithm for this? Thanks in advance. Please, include the question in the body, not just in the header. The algorithm has two parts: (1) Find the closest points on the full lines. (2) Limit the answer by the ends of the line segments. If the question is posed in 2D, it's trivial enough to not require an answer, so we may assume it is meant for 3D. The only interesting part of the question is how to find the closest points on...

pointed line segment between two points
Hi, I have two vectors (x and y) containing coordinates of points. I have to join x(1),y(1) and x(2),y(2). I need an arrow ONLY at end point (i.e. x(2),y(2). I do not need arrow at x(1),y(1). The graph will be 2D. How do I do this? ...

closest point on a circle to a line segment
Given a line segment p1, p2 and a circle p, r -- how can I find the point on the circle which lies closest to the line segment? TIA "Wilson McGramer" <loargy_13032@yahoo.com> wrote in message news:q2W6d.1228$4C.499479@twister.nyc.rr.com... > > Given a line segment p1, p2 and a circle p, r -- how can I find the point > on > the circle which lies closest to the line segment? Are your objects in 2D or in 3D? -- Dave Eberly http://www.magic-software.com > Are your objects in 2D or in 3D? they're in 2D "Wilson McGramer" <loargy_13032...

nearest points on two line segments
Hello. I need to calculate the distance between two line segments on a plane. I have no trouble calculating the distance between a point and a line segment, but when I go to two line segments, I get too many cases. I need to code this quickly for a prototype. What would help is a library that already has this routine, ideally in C. Do you know of one? Thanks, Rick v1 = a + tb v2 = c + sd min || a-c - tb -sd || should give u a quadratic in t and s. minimize subject to t \in (t1,t2), s in( s1,s2) introduce two new variabl...

Point on Line Segment in 3D ? Fast Algorithm
Hello, Im looking for a fast algorithm to determine if a point (3D) is inside a line segment (3D). Can you help me ? Regards Jens "Jens Hilwig" <jhilwig@gmx.de> wrote in message <6a9sqqF35gdblU1@mid.uni-berlin.de>... > Hello, > > Im looking for a fast algorithm to determine if a point (3D) is inside a > line segment (3D). > Can you help me ? > > Regards > > Jens ---------- If P1 and P2 are vectors giving the endpoint coordinates of the line segment and P the coordinates of an arbitrary point, then P lies ...

Point on Line Segment in 3D ? Fast Algorithm
Hello, Im looking for a fast algorithm to determine if a point (3D) is inside a line segment (3D). Can you help me ? Regards Jens I know that there is alreday an old thread for this problem but it did not helped me http://groups.google.de/group/comp.graphics.algorithms/browse_thread/thread/cfbb63dc4d14fb9d/02595483c07801cf?hl=de&lnk=st&q=point+on+line#02595483c07801cf Jens Hilwig wrote: > Hello, > > Im looking for a fast algorithm to determine if a point (3D) is inside a > line segment (3D). > Can you help me ? What you actually want is capsule-point intersec...

Point of closest intersection and minimum distance between two lines
Hi, i have two lines defined as: l1 = r1*a1+m1 l2 = r2*a2+m2 where a1 and a2 are two vectors a1=[cos(alpha1), cos(beta1), cos(gamma1)] a2=[cos(alpha2), cos(beta2), cos(gamma2)] r1 and r2 are two scalar, they rappresents a point on the lines m1 and m2 are the point from which the line starts (it'is a traslation) How can i find the minimum dinstance between this two lines? And how can i find the points of closest intersection? This really looks like homework (hint: write the squared distance, compute partial derivatives, solve for zero with matlab) (less painful hint: you get the minimu...

plotting a point on a line between two points
Hi Sorry if this is totally elementary, I really should have paid more attention in math class! If I have two points(in 3d space), lets say point 1 is(1,2,5) and point 2 is (4,8, 50), and I want to plot an arbitraray point on a line between the two points but only know the third value, so point 3 is (x,y, 15) what mathematical formula do I use to figure out x and y? Again, sorry as I am sure this is totally elementary, but I have spent the better part of the morning googling this and many other groups to no avail. Thanks Mike Cardeiro mcardeiro@yahoo.com wrote: > If I have two poi...

Re: GUI Graphics: draw a line between two pre-specified points
Hi: Any help to the following GUI-graphics problem is greatly appreciated! I want to draw a line between a pair of points (the first point represents an input to a math function, and the 2nd point represents the output of the function). The pair of points are already pre-specified in a GUI. This could be looked at as multiple number of input points, and similarly a multiple number of output points. This means that I need to draw multiple lines between the two sets of (I/O) pairs that look like the mapping (behavior) of the function that to be represented graphycally. i.e. the overall picture...

Minimum number of straight line segments between two points at the ends of a planar sequence of triangles
Hi - I'm, trying to solve the following problem. I'm not sure if its been solved (no need reinventing the wheel if it has). Any information, pointers or solutions will be welcome. Thanks, - Olumide -------------------------------- Description -------------------------- Given a sequence of n coplanar triangles, T[1] ... T[n], such that each interior triangle T[i] shares and edge with its neighbors T[i-1] and T[i+1]. The triangles T[0] and T[n] have only one neighbor each (T[1] and T[n-1] respectively), and contain a start and and end point A and B respectively, as illustrated in th...

Draw a line between two points in two images
Hello PPL, How can I draw a line between two points (start point in image 1 and finish point in image 2) in two differenr images? By this code I will get a line drawn between two points in the SAME image but I don't know how to fix it to meet my request. subplot(1,2,1), line([x1(z),y1(z)], ([x2(z),y2(z)],'color',color(mr),'marker',marker(n), 'MarkerSize', 9, 'LineWidth', 2); Thanks, Salha Salha wrote: > How can I draw a line between two points (start point in image 1 and finish > point in image 2) in two differenr images? You can only draw point...

Thick Lines drawing in two colors between only two points
Hi, I'm having a weird problem with openGL. I have an Ada application that uses openGL to render in 3D. It runs on a Linux machine, but I connect to the server through my windows work station using an exceed session. When I run the application and send the 3D display to my windows machine, it renders lines correctly. However, when I go to the lab, and run the application directly under linux, I see the following problem with my lines. a) Any thick line (GLlinewidth > 5) between 2 points (say from point A to point B), is drawn half of the length in the color I specify and the other half...

Draw a line between two points in two images for image registration
Hi I am trying to register (align) two images and I want to draw a line going from (x1,y1) in first image to (x2,y2) in the second image. I want to actually write the line into the image pixels. Can anyone explain me how it can be done. Regards, Parthi Try this demo: % Demo to write an ellipse and a line into the overlay of an image, % and then to burn those overlays into the image. %----- Initializing steps ----- % Clean up clc; clear all; close all; workspace; % Display the workspace panel. hasIPT = license('test', 'image_toolbox'); if ~hasIPT ...

how to determine if the shortest distance from one point to a line is inside the line segment or outside
Hello everyone, We know how to determine the shortest distance from a point to a line. http://www.mathworks.com/support/solutions/en/data/1-1BYSR/index.html?product=ML&solution=1-1BYSR However, can someone point me of a way of how to determine if such minimum distance fall within the line segment or it is determine it with respect to its projection. for example for the line line=[-15 -30 -50 75 -70 95] point=[0 0] for the first segment of the line the shortest distance (perpendicular distance) falls within the line segment but for the second segment the shortest distan...

triangle-point triangle-line segment and triangle-triangle closes point question
Hi! The subjects tells it all, both Eberly's 3DGED book and Ericson's RTCD book treat these problems. Eberly's treatment seems overly complicated to me (although correct) and Ericson's a bit vague (he makes assertions without proofs). Are there other resources about calculating these closest points I could use? I'd like to implement the Lin-Canny algorithms which needs these calculations. "keith" <johndoe64738@yahoo.com> wrote in message news:h793ge$7fc$1@news.eternal-september.org... > Hi! The subjects tells it all, both Eberly's 3DGED book and Eri...

how to do the intersection between a plane (know one point and normal vector) and a line (know two points)
undefined Hi that is pretty straighthforward math. what you need: plane equation: ax + by + cz + d = 0 two 3D points p1 and p2 ###################################################################### function p_out = intersect_plane_line(a, b, c, d, p1, p2) v = p1 - p2; l = - (a*p1(1) + b*p1(2) + c*p1(3) +d) / (a*v(1) + b*v(2) + c*v(3)); p_out = p1 + l*v; ###################################################################### hope that helps Peter ...

points between two points
How can i write the set of points between point A and point B? On 8/22/2012 8:40 PM, Weam Zohdy wrote: > How can i write the set of points between point A and point B? That's an infinite set theoretically. What particular set did you have in mind? -- On 23 Aug., 03:40, "Weam Zohdy" <weamzohd...@yahoo.com> wrote: > How can i write the set of points between point A and point B? t*A+(1-t)*B for 0<=t<=1. Best wishes Torsten. ...

Point closest to a set of lines
Hi, I have a set of lines (lets keep it simple to 2D). In an ideal case these s= hould intersect at som point. Each line indicates the direction of arrival = of a signal on some source in space. But the medium in which the wave trave= ls may not be homogenous, so there may not be such a point. But there shoul= d be a point closest to all the lines, somewhere in the neighbourhood of th= e ideal point. Having the equations for the lines, how do I set up the (I s= uppose least square solution) in matlab? Thanks for listening, Kamran On 8/12/2012 11:00 AM, kamran.iranpour@gmail.com wr...

distance from point to line segments
I have multiple points and line segments in 2D space and i have to find, for each point, line segment that is closest to that point. Is there a fast way to do that, instead of calculating distance from each point to all lines? Thanks, Blaz On May 11, 4:46=A0pm, Blaz <blaz.brata...@gmail.com> wrote: > I have multiple points and line segments in 2D space and i have to find, > =A0for each point, line segment that is closest to that point. > =A0Is there a fast way to do that, instead of calculating distance from > each point to all lines? > > Thanks, > Blaz --------...

Cosine between two segment lines
Hi! My question is the following. There are two segment lines defined by two data sets. I need to know the deviation of the first curve from the second curve. For this purpose I suppose to use cosine angle. I want to go through the segment lines and estimate cosine angle step-by-step in case of any deviation. My code is the following: data_set1 = [1 1 2; 2 3 4; 2 1 1]; data_set2 = [1 1 2; 2 4 4; 2 2 1]; Cosine = dot(data_set1',data_set2')/(norm(data_set1')*norm(data_set2')); CosineInDegrees = acos(Cosine)*180/pi; Avg = sum(CosineInDegrees)/length(CosineInDegrees); Please giv...

closest polygon segment to points
Just wondering if anyone has a good method for this one... You have a bunch of points in a 2D plane and for each point you would like to find the closest wall segement in a (non-convex) polygon. A brute-force solution is to loop through each point and for each point to loop through every wall in the polygon, find the normal distance between point and polygon and save the minimum as you go. If you have N points and M walls this is an O(M*N) operation - not good. I know that the fast marching method is a good choice for constructing the distance function (approximately) but I'm more inte...

Draw line between two points
Hello, I have a 2 x n matrix full of rank in which each row corresponds to cartesian coordinates; call this matrix X. Also, I have a plot command which draws a circle dependent on the data X formed by optimization. Suppose that the center of this circle is z = [z(1) z(2)]'. (column-vector) Finally: On top of plotting the above circle, I would like to draw the 'remainder lines' relative to the center of the circle, i.e, lines reprenting how "far" the points are to the perimeter of the circle of radius r (scalar). Currently, I have the following command for the first da...

how to draw a line between two points
dear folks I need to draw a line which connects two points (x1,y1) and (x2,y2) together. what function to do it in matlab? Thank you very much Sincerely plot([x1 x2],[y1 y2]) thanhhahuy@gmail.com wrote: > dear folks > > I need to draw a line which connects two points (x1,y1) and (x2,y2) > together. > what function to do it in matlab? > > Thank you very much > > Sincerely ...

print line between two points
Hello, I plot some points in a GUI with this command : plot(c,r,'r+'); where c and r are two vectors with same size. Than I select, by a determinate criteria, two couple of points c(i), r(i) and c(j), r(j). Now I want to draw a line between these two points how must I do? I wrote this command: line([r1(i) c1(i)], [r2(j) c2(j)]); but the line ploted on the GUI do not corresponding at the points selected. Thanks for help me Andrea "andrea " <nacchio1983@yahoo.it> wrote in message news:guecvh$eva$1@fred.mathworks.com... > Hello, > > I plot some points in a...

Web resources about - Closest Points between two line segments - comp.graphics.algorithms

Seven-segment display - Wikipedia, the free encyclopedia
A seven-segment display ( SSD ), or seven-segment indicator , is a form of electronic display device for displaying decimal numerals that is ...

Blueye Launches Loyalty Hub, Enabling Marketers To Identify, Segment Most Valuable Facebook Fans
Social commerce provider Blueye launched engagement platform Loyalty Hub , aimed at aiding brands in creating, managing, and monetizing multistage ...

For US Hispanic Marketers, New Language-Based Targeting Segments
Today we’re launching new language-based targeting segments designed to help advertisers with Hispanic marketing efforts in the US deliver more ...

segments - Flickr - Photo Sharing!
8 meter long tapeworm (!!!) at the Meguro Parasitological museum, in the Meguro neighborhood of Tokyo, Japan.

YouTube - The Magic Boomerang (1966) Opening segment
You are using an outdated browser, which YouTube no longer supports. Since some features on YouTube may not work, you are viewing a lightweight ...

Play School segment to feature gay fathers
Play School will test public acceptance of gay parenting with depiction of gay dads.


The Daily Show segment about Australians and Gun Control wins an Emmy
Former politicians John Howard, Tim Fischer and Rob Borbidge aren't the first names which spring to mind when you think of TV's annual Emmy Awards. ...

Pete Evans paleo: Chef blasted online after Sunday Night segment - HeraldSun Search Search
CELEBRITY chef Pete Evans’ paleo diet crusade has been compared to Hollywood actor Tom Cruise spruiking Scientology.

Chilean Deluge Disrupts a Fraction of Country’s Mining Segment
The torrential rain that hit the region forced most of the mining companies to shut down temporarily.

Resources last updated: 2/24/2016 1:45:42 PM