Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

2d math question

This topic is 6598 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hmm, let me give this a try. . .

First you have to find this slope of the first line. Get y2-y1, and put it over x2-x1. Say it is 5/3. Next you find the slope of the perpindicular line by getting the negative reciprical. For this is would be -3/5. I'm not sure what you mean next, but once you have the slope it shouldn't be hard to find the endpoint of a segment, as long as you have a starting point for this segment. Anyway, I probably didn't answer that right because I don't totally understand what you're asking. . .


Share this post


Link to post
Share on other sites
If (x1,y1) to (x2,y2) is the first line you need to find a point (x3,y3) so that the line (x1,y1) to (x3,y3) is of length L and perpendicular to (x1,y1) to (x2,y2), right?

Something like this should do the trick:

a= L / L1

x3=x1 + a * -(y2-y1)
y3=y1 + a * (x2-x1)

L1 is the length of the first line. Just off the top of my head so I might've screwed it up !!

/Niels

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Say you have an arbitrary line in 2d space with endpoints x1,y1 and x2,y2. Is there a computationally efficient way that I can calculate the endpoint of a line
of length (L) perpendicular to the line defined by endpoints x1,y1 and x2,y2.

Your help is greatly appreciated. If at all possible, can someone give me a detailed answer with example.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Just to try to finish the other reply, take the x_slope and y_slope L is the length of the line. k ,
x_slope = ylen/xlen
y_slope = xlen/ylen
x3 = L*x_slope
y3 = L*y_slope

Try somtin like dat, hope it works, not exactly sure about the length of the line, but yo probaly figure it out ,
jus tryin ta help,
later

Share this post


Link to post
Share on other sites