The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Color according to concavity
Replies: 1   Last Post: Dec 3, 2012 3:30 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Sergio Miguel Terrazas Porras

Posts: 42
Registered: 6/16/05
Re: Color according to concavity
Posted: Dec 3, 2012 3:30 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Thank you, Bob and Murray.

Desde: Bob Hanlon []
Enviado el: jueves, 29 de noviembre de 2012 09:52 a.m.
Hasta: Sergio Miguel Terrazas Porras
Asunto: Re: Color according to concavity

f[x_] = Sin[x] Cos[2 x];

Plot[f[x], {x, 0, 4 Pi},
ColorFunction -> Function[{x, y},
If[f''[x] < 0, Red, Blue]],
ColorFunctionScaling -> False]

Bob Hanlon

On Thu, Nov 29, 2012 at 6:04 AM, Sergio Miguel Terrazas Porras
<> wrote:
> Dear fellows at mathgroup:
> I want to plot a function with the color of the parts of the curve accord=

ing to concavity, say Red when concve down an blue when concave up.
> I can do it by brute force, finding whwn the second derivative is cero, a=

nd then finding the sign of it in the different intervals, etc. This for pa=
rticular examples.
> But, is there a way to use the second derivative as part of a ColorFuncti=

on, or something like that?
> Thanks

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.