Re: Sawtooth formula?
- From: David W. Cantrell <DWCantrell@xxxxxxxxxxx>
- Date: 15 Apr 2006 06:36:08 GMT
"WebSnozz" <shumaker@xxxxxxxxxx> wrote:
This works perfectly with the exception of input of 40 is giving me
output of 40 on my computer. It looks like it is not definetly either
40 or 0.
You're right. I apologize. The formula I gave works fine except when x is
an integer multiple of 40. But this problem may not be easily overcome if
you really want a formula using trig and inverse trig functions.
I was hoping for something that would descend from 39 to 0 on
the inputs 39 to 40, such that input 39.9 gives something like 0.1,
If that were true, it would not truly be a sawtooth.
so
that at the input of 40, there is no question about the output being 0.
That's a different matter.
Are you just trying to program this on a computer? If so, there should be
no reason to use trig functions! Do you have available a function which
gives the remainder when x is divided by y? It might be called mod(x, y).
If so, then
Sawtooth(x) = mod(x, 40)
should be exactly what you need.
David
.
- Follow-Ups:
- Re: Sawtooth formula?
- From: Ray Koopman
- Re: Sawtooth formula?
- References:
- Sawtooth formula?
- From: WebSnozz
- Re: Sawtooth formula?
- From: David W . Cantrell
- Re: Sawtooth formula?
- From: WebSnozz
- Re: Sawtooth formula?
- From: WebSnozz
- Sawtooth formula?
- Prev by Date: Re: Strategy for caputuring FLT
- Next by Date: Re: JSH: Things never before done
- Previous by thread: Re: Sawtooth formula?
- Next by thread: Re: Sawtooth formula?
- Index(es):
Relevant Pages
|