# Finding a coordinate with no intermediate variables

I want to know if it possible, using only the $+ - \div \times$ operators to solve a simple geometry problem. The questions is further complicated because I want to integrate it into a very restricted equation editor (ie: I don't have a full programming language).

I know three points, $(x_1,y_1),(x_2,y_2), (x_3,y_3)$ and I don't know $(x_4,y_4)$. The blue line is the shortest route from $(x_3,y_3)$ to the red line.

I know this would usually involve a dot product, and what is effectively a simultaneous equation, but I need the answer in terms of two one line equations. No variables or intermediate steps are possible.

$x_4 = \text{long line of calculations}$

$y_4 = \text{second long line of calculations}$

The answer doesn't have to be very precise, so an approximation would be equally helpful.

-
Step 1: find slope of AB. Step 2: immediately get slope of CD. Step 3: find equation of line AB/CD. Step 4: Solve the linear equation system. Step 5: Incorporate the four steps into a single program, each step being a small module and can handle input-errors, etc. –  FrenzY DT. Aug 12 '12 at 13:31

The right angle comes from $${y_4-y_3\over x_4-x_3}=-{x_2-x_1\over y_2-y_1},$$ and the 4th point being on the line with the first two comes from $${y_2-y_4\over x_2-x_4}={y_2-y_1\over x_2-x_1}$$ That gives you two linear equations in the two unknowns, $x_4$ and $y_4$. Can you solve two linear equations in two unknowns?