CTK Exchange
Front Page
Movie shortcuts
Personal info
Awards
Reciprocal links
Terms of use
Privacy Policy

Interactive Activities

Cut The Knot!
MSET99 Talk
Games & Puzzles
Arithmetic/Algebra
Geometry
Probability
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
My Logo
Math Poll
Other Math sit's
Guest book
News sit's

Recommend this site

Manifesto: what CTK is about Search CTK Buying a book is a commitment to learning Table of content Products to download and subscription Things you can find on CTK Chronology of updates Email to Cut The Knot Recommend this page

CTK Exchange

Subject: "a = sin(f(x) * n); n = ???"     Previous Topic | Next Topic
Printer-friendly copy     Email this topic to a friend    
Conferences The CTK Exchange College math Topic #596
Reading Topic #596
oniwaka
guest
Dec-13-06, 03:16 PM (EST)
 
"a = sin(f(x) * n); n = ???"
 
   I'm being haunted by this problem! My only solution at this point is the dirtiest of programmers tricks(the lookup table), which is workable for the level of precision I need. However, I can't help but think there's a better solution.

a = sin(f(x) * n)
or
a = (exp(complex(0, f(x) * n)) - exp(-complex(0, f(x) * n))) / 2j

a and x are known

Thanks in advance for any help you might offer.


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
alexb
Charter Member
1930 posts
Dec-13-06, 03:23 PM (EST)
Click to EMail alexb Click to send private message to alexb Click to view user profileClick to add this user to your buddy list  
1. "RE: a = sin(f(x) * n); n = ???"
In response to message #0
 
   Even assuming f(x) is a known function, the problem does not have a unique solution. Regardless, it requires a more or less standard application of arcsin:

f(x)*n = arcsin(a) or
f(x)*n = π - arcsin(a).

There may be a question of efficiency of course, in which case a lookup table may be a viable alternative.


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
oniwaka
guest
Dec-13-06, 09:19 AM (EST)
 
2. "RE: a = sin(f(x) * n); n = ???"
In response to message #1
 
  

Thank you. I'll be able to rest easily now. Maybe I should take a math refresher course...

I compiled a quick benchmark, and the lookup table is indeed faster in C. But since I'm prototyping in python, which has non-negotiable float precision (requiring type conversion for each lookup), arcsin(a)/f(x) is actually faster.

Thanks again.


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top

Conferences | Forums | Topics | Previous Topic | Next Topic

You may be curious to have a look at the old CTK Exchange archive.
Please do not post there.

Copyright © 1996-2018 Alexander Bogomolny

Search:
Keywords:

Google
Web CTK