#### Archived

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

# 2d math question

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

## 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 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 on other sites
Just general help, if all else fails--turn to a math book or website. The other responces are correct, they just might be a little difficult to understand.

##### Share on other sites
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 on other sites
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

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 13
• 19
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632930
• Total Posts
3009289
• ### Who's Online (See full list)

There are no registered users currently online

×