Maybe you want to first reduce the angle a+x to be between 0 and 2*pi radians and then use the usual series expansion:
cos(z) = 1 - z^2/2 + z^2/24 - z^6/720 + ...
R
Rich Grise
Once you collapse it down, (i.e. 0..2*pi) wouldn't a LUT be quicker? :-)
Thanks, Rich
N
Narasimham
a >> x ?
I suppose a is a constant.So in cos(a) cos(x) - sin(a) sin(x), expand sin(x) and cos(x) in x upto four terms.
Narasimham
M
mrdarrett
a >> x?
Would a situation where a=6300 pi and x=pi meet these constraints? This satisfies a >> x, but in this case, cos( 6300pi + pi ) is nowhere near cos( 6300 pi )...
Or did you mean to say pi >> x?
-- Michael Darrett, Senior Computer Resource Specialist Wireless network setup, computer upgrades and repair. Sacramento, California
formatting link
P
Phil Carmody
where a >> x ?
Truly awful idea.
Just use the standard method to work out the Taylor expansion about a. Yes, yes, this means taking derivatives, but this is sci.math not sci.sums.
Phil
"Home taping is killing big business profits. We left this side blank
so you can help." -- Dead Kennedys, written upon the B-side of tapes of
/In God We Trust, Inc./.
G
Greg Neill
Could be. That or a CORDIC algorithm, depending upon the available hardware.
T
The Qurqirish Dragon
Since cosine is 2pi periodic, you need to explain what you mean by a>>x here. For example, if a is any multiple of 2pi, then cos (a+x) = cos (x), so by choosing an appropriate multiple of 2pi, I can always have a >> x, and just look at cos (x) instead.
for that matter, I can even have a dependant on x: a(x)=2000pi *(1+ | [[x]] | ), where [[x]] is the greatest-integer function. If you need a to be even larger, increase the coefficient of pi until it is big enough for you.
D
Don Lancaster
a >> x ?
That is the direction I was looking at. For very small (x), cos (x) is pretty much unity and sin(x) in radians is pretty much x.
Which degenerates to the two term Taylor expansion cos(a+x) = cos(a) - x*sin(a)
I'm trying to convert a rapidly converging Magic Sinewave solution into an instant one. More at
formatting link
cos(a) - x*sin(a) won't quite hack it.
Many thanks,
Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: don@tinaja.com
Please visit my GURU\'s LAIR web site at http://www.tinaja.com
C
Chip Eastham
where a >> x ?
Hi, Phil:
I'm not clear why you think the suggestion an "awful idea".
We get the same power series expansion your way, do we not, as by Narasimham's suggestion? The advantage of the latter being that the MacLaurin series for sin,cos are probably well known enough that a calculus student can do it by inspection:
If there's something awful here, it's that Don's original assumption a >> x is not sufficient to warrant x
D
Don Lancaster
where a >> x ?
Everything happens in the first quadrant. Sorry I was not more specific on this.
Many thanks,
Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: don@tinaja.com
Please visit my GURU\'s LAIR web site at http://www.tinaja.com
J
James Waldby
...
...
... I think you degenerated a term or two too far. cos(a+x) = cos(a)cos(x) - sin(a)sin(x) sin(x) = x - x^3/3! + x^5/5! - x^7/7! + ... cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! + ... so cos(a+x) ~ cos(a)(1 - x^2/2 + x^4/24) - sin(a)(x - x^3/6). Whether you can drop the x^3/6 and higher terms depends on a and x. Substitute typical values of a and an extreme value of x and see if your accuracy criterion is met.
It would help more if you used Cos[a+x] instead of Cos[a*x].
Dave Seaman
U.S. Court of Appeals to review three issues
concerning case of Mumia Abu-Jamal.
D
Denis Feldmann
and, of course, the knowledge of cos(a+x)=cos(a)*cos(x)-sin(a)*sin (x), giving the first terms as cos(a)-x*sin(a)-(x^2/2)*cos(a)+(x^3/6)*sin(a) could help too..0
D
Dana DeLouis
OOps! Thanks Dave! I totally missed that important detail.
Sorry. Dana
N
Narasimham
where a >> x ?
Please see responses from Chip Eastman and OP Don Lancaster.Also when x
P
Phil Carmody
where a >> x ?
As I misinterpreted the freedom of the variable in "expand sin(x) and cos(x)", infering "expand sin() and cos()". Thus cos(a) and sin(a), being cos(x) and sin(x) at x=a, would also be expanded, yielding noise.
Phil
"Home taping is killing big business profits. We left this side blank
so you can help." -- Dead Kennedys, written upon the B-side of tapes of
/In God We Trust, Inc./.
K
kell
I think Taylor converges even for large x, but to get a good approx in a few terms it helps if x
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.