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

First of all; I'm a programmer, not a mathematician so please excuse the informality of my math-vocabulary.

I have a series of slopes, calculated out of random angles (their tangents). These angles will always be located in the I and IV quadrants i.e. there are no angles "pointing to the left".

As you probably know, the tangent curve goes from -infinity to +infinity in this range.

I need to normalize the slopes into a range from -1 to 1. This means that the slope of an angle approaching (pi/2) should get closer and closer to 1 instead of infinity.

I would like to know how to do this in two ways:

1) Preserving a smaller tangent curve in my new range

2) Making it a linear range

share|cite|improve this question
It isn't clear to me what exactly you want to do. Why not just normalize the angles to be from -1 to 1? – Bitwise Sep 25 '12 at 22:10
up vote 0 down vote accepted

I'm not sure if this is what you're looking for, but you could first normalize your point so that it is at distance $1$ from the origin, then take the resulting $y$-coördinate.

In other words, given $(x,y)$, you would be calculating $\frac{y}{\sqrt{x^2+y^2}}$, which is the sine of the angle from the $x$-axis.

share|cite|improve this answer
To put it another way, if you are not given the point $(x,y)$ but only the tangent $t$, you can calculate $\frac{t}{\sqrt{t^2+1}}$. – Théophile Sep 28 '12 at 18:13

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.