Search All of the Math Forum:

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

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

 Sergio Miguel Terrazas Porras Posts: 42 Registered: 6/16/05
Re: Color according to concavity
Posted: Dec 3, 2012 3:30 AM

Thank you, Bob and Murray.

________________________________________
Desde: Bob Hanlon [hanlonr357@gmail.com]
Enviado el: jueves, 29 de noviembre de 2012 09:52 a.m.
Hasta: Sergio Miguel Terrazas Porras
CC: mathgroup@smc.vnet.net
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
<sterraza@uacj.mx> 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
>
>=