2

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

3 Answers3

2

$\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$

Ant
  • 21,098
Scientifica
  • 8,781
1

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)$.

Austin Mohr
  • 25,662
-1

$$\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}$$

DanielV
  • 23,556
  • 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