Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

Diagram of the problem

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.

share|cite|improve this question
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 Li 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?

share|cite|improve this answer
"two linear equations in the two unknowns" - in that regard, @Patrick: look up Cramer's rule. – J. M. Aug 12 '12 at 13:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.