Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Is it possible to interpolate a polynomial that approximates Sin, and then be able to manipulate the polynomial or a sample of its points to make sections of the plotted curve progressively steeper?

Basically, I'd like to be able to make a plot showing, over a suitable domain, Sin and Abs[Sin[]] and everything in between.

share|improve this question

closed as unclear what you're asking by Jens, Mr.Wizard Jun 28 at 17:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

What does making sine steeper have to do with its absolute value? It sounds like you want to interpolate between the two, which might be done with f[t_, x_] := (1-t) Sin[x] + t Abs[Sin[x]]; for t between 0 and 1, you get a function of x between Sin[x] and Abs[Sin[x]]. –  Michael E2 Aug 6 '13 at 19:28
In general appearance, I want the first graph to look like a sine wave and the last graph to look like abs(sine). Abs(sine) is very "pointy." I want to be able to gradually progress to that "pointiness" from the sine curve. –  meihua Aug 7 '13 at 15:16
Do you insist on a polynomial approximation? See my nonpolynomial answer below. (This question seems to be more about mathematics and not about the features of Mathematica per se.) –  Michael E2 Aug 7 '13 at 15:28

1 Answer 1

Implementing my comment, a linear interpolation between sine and its absolute value:

 Plot[(1 - t) Sin[x] + t Abs[Sin[x]], {x, -2 Pi, 2 Pi}, PlotRange -> 1],
 {t, 0, 1}

enter image description here

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.