# How to express the meaning I mention in one formula?

There are two points: $(x_1,y_1),(x_2,y_2)$, if $|y_2-y_1|>|x_2-x_1|$ then $\tan(A)=\frac{|y_2-y_1|}{|x_2-x_1|}$ else if $|y_2-y_1|<|x_2-x_1|$ then $\tan(A)=\frac{|x_2-x_1|}{|y_2-y_1|}$

My question is, how to express the above meaning in one formula? what kind of Mathematical symbol should I use? thanks.

-
I think it is bad form to define $\tan(A)$. The function $\tan$ already has a specific meaning. It is better to use cases to define the angle $A$, then let $\tan$ have the usual meaning. – Austin Mohr Jul 21 '14 at 21:48
Yes, you are right, it is better to define angle A. Thanks. So, if I define angle A, how to express? – Eric Huang Jul 21 '14 at 21:51

As I mentioned in the comment, I think it is bad form to overload the $\tan$ function.

If you are doing many trigonometric operations with this triangle, then it is best to clearly define all its parts. Doing so allows you to use cases to choose the appropriate angle, and then the trigonometric functions can have their usual meaning.

If you just need this one value, then forget about $\tan$ altogether and write something like:

Let $a = \max\left(\dfrac{|x_2-x_1|}{|y_2-y_1|},\dfrac{|y_2-y_1|}{|x_2-x_1|}\right)$.

-
thank you, I think it is better to use this form. – Eric Huang Jul 21 '14 at 22:00

$\tan(A)=\dfrac{\max(|x_2-x_1|,|y_2-y_1|)}{\min(|x_2-x_1|,|y_2-y_1|)}$

Or:

$\tan(A)=\max\left(\dfrac{|x_2-x_1|}{|y_2-y_1|},\dfrac{|y_2-y_1|}{|x_2-x_1|}\right)$

where $\max(a,b)$ equals the greatest of $a$ and $b$

-
Thanks very much for your inspiration. – Eric Huang Jul 21 '14 at 22:00
You're welcome! – Scientifica Jul 21 '14 at 22:02

$$\tan(A) = \begin{cases} |y_2 - y_1| \ge |x_2 - x_1| &: \huge{\frac{|y_2 - y_1|}{|x_2 - x_1|}} \\ \\ \\ |y_2 - y_1| \le |x_2 - x_1| &: \huge{\frac{|x_2 - x_1|}{|y_2 - y_1|}} \\ \end{cases}$$

-
Sorry, I want to express it in one formula using some Mathematical symbol, such as sign or some else. Do you have other method ? Thanks. – Eric Huang Jul 21 '14 at 21:48