Omnimaga
General Discussion => Other Discussions => Math and Science => Topic started by: ruler501 on March 03, 2011, 11:31:19 pm
-
I want to create an equation that works kindof like the sin/cos function but has irregular zeros. It needs to have maximums of 1 and minimums of -1. How would I do this? Thank you for any help.
-
Sin(x2) or Cos(x2) should work. If you need something less predictable, may I recommend 2Rand-1?
-
i already have specified values for all zeros. I just need to control how the graph acts in between them
-
Oh, that's a very different question from what I was answering. However, I can tell you right off the bat that if you have more than about 5 irregular zeros, you're not going to be able to compute one of the equations very quickly. I'd recommend that you read up on Interpolation (http://en.wikipedia.org/wiki/Interpolation) and especially Polynomial Interpolation (http://en.wikipedia.org/wiki/Polynomial_interpolation) to figure out the equation. It depends on how irregular your data points truly are, but your function will probably have a degree on the order of N-1, where N is the number of data points.
-
If they're really THAT irregular you can always use a data-smoothing algorithm such as a uniform b-spline.
-
I think the point is to have a random function, not a smooth one ;)
-
I want to create an equation that works kindof like the sin/cos function
[/quote
This made me think of curves. That made me think of b-splines.