# How do I find a random point on the hypotenuse?

• Jun 20th 2007, 02:45 PM
worldspawn
How do I find a random point on the hypotenuse?
I'm trudging through 5-6 years worth of forgotten math lessons and can't remember how to do this. I have a right triangle, the two sides both are equal to 30 so the angles are a clean 45 degrees a piece. I need to know how to determine the x,y coords of a random point on the hypotenuse. I have a diagram but forgive it's crudeness, it's just an example:

http://www.innerfilth.com/%7Emike/distance.gif

Those red dots are what I need to figure out. Ignore their position, since it's just an example. If I pointed to a random spot on that line, what math do I need to figure out the coords?
• Jun 20th 2007, 03:09 PM
Soroban
Hello, worldspawn!

The points are on the line: . $x + y \:=\:30\quad\Rightarrow\quad y \:=\:30- x$

So given an $x$-value, say, $x = 7$, then: . $y \:=\:30 - 7 \:=\:23$

Therefore, the point is: . $(7,\,23)$

• Jun 20th 2007, 03:09 PM
OReilly
Quote:

Originally Posted by worldspawn
I'm trudging through 5-6 years worth of forgotten math lessons and can't remember how to do this. I have a right triangle, the two sides both are equal to 30 so the angles are a clean 45 degrees a piece. I need to know how to determine the x,y coords of a random point on the hypotenuse. I have a diagram but forgive it's crudeness, it's just an example:

http://www.innerfilth.com/%7Emike/distance.gif

Those red dots are what I need to figure out. Ignore their position, since it's just an example. If I pointed to a random spot on that line, what math do I need to figure out the coords?

You need to use Deep Blue.
• Jun 20th 2007, 03:56 PM
Plato
Selecting any point on that line segment is a uniform distribution. We can model it this way: select a number uniformly in the interval [0,30]. Call it a, then the corresponding point on the line segment is (a,30-a).