Calculating position along the hypotenuse 
The blue dot moves, I know its x and y coordinates, and I also know that that causes the red dot to move along the triangle's hypotenuse in such a way that the red dot's y coordinate is always equal to the blue dot's y-coordinate. 
How do I calculate the x value of the red dot's coordinate?
 A: Making the assumptions stated in the comments, and further that the lower leg of the triangle is horizontal as pictured, and $m$ is the slope of the hypotenuse.
Then $y_{\text{red}}/x_{\text{red}} = m$, $y_{\text{red}} = y_{\text{blue}}$. Solving gives $x_\text{red} = y_\text{blue}/m$.
A: Assume the base of the triangle is horizontal at with the vertex at $(0,0)$ and length $x$.  Furthermore, the triangle is right with a height $h$. Define the coordinates of the blue point as $(x_1,y)$ and the red point as $(x_2,y)$.  Then, we want $x_2$ as a function of the common y-cordinate.
From basic trig, the interior angle between side x and the hypotenuse is given by $sin^{-1}\left(\frac{h}{x}\right)=\theta$.  Note that when the the blue dot is at any height $y$ , $0\leq y\leq h$, drawing a vertical line from the red dot to the base forms a similar triangle with height y and base $x_2$. The angle between the base and hypotenuse will simply be $\theta$.    Thus, we have from basic trig:$$sin(\theta) = \frac{y}{x_2} \Rightarrow sin\left(sin^{-1}\left(\frac{h}{x}\right)\right) = \frac{y}{x_2} \Rightarrow x_2 = \frac{y\cdot h}{x}\;\;\;0\leq y \leq h$$ Which gives the x-cordinate of the red point in terms of the givens.      
