Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

**luca-deltodesco****Member**- Registered: 2006-05-05
- Posts: 1,470

a friend posted me the following problem:

inverse tangent is multi-valued and restricts its result to the range -½π to ½π. how can i get back to the original number if it wasn't in this range? obvously thats impossible since from the result you can have no idea, but he added the restriction of it being a positive integer, and thus becomes feasable

my answer was: (inp is the result of the inverse tangent)

while ((inp += pi)-int(inp)>1e-8);

which works up to the limit of numerical accuracy (only works up to about 200 before failing due to numerical innacuracies)

so as an example.

set inp to atan(tan(125)); run the loop, and you get inp=125.000000016

not very difficult at all, but i still found it interesting

*Last edited by luca-deltodesco (2008-01-03 03:24:29)*

The Beginning Of All Things To End.

The End Of All Things To Come.

Offline

**MathsIsFun****Administrator**- Registered: 2005-01-21
- Posts: 7,619

Is it necessary to work out every "inp + n(pi)" until you find it?

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman

Offline

**luca-deltodesco****Member**- Registered: 2006-05-05
- Posts: 1,470

well the problem is, how would you find out how many pi's you have to add to get to an integer?

The Beginning Of All Things To End.

The End Of All Things To Come.

Offline

**mikau****Member**- Registered: 2005-08-22
- Posts: 1,504

aye, but that seems like... i'm not sure.

could we possibly prove that it is the exact answer?

I guess we can't be sure unless we can find an expression for the tangent of some integer that fits on one piece of paper.

A logarithm is just a misspelled algorithm.

Offline

Pages: **1**