Shaper::secondSlope()
Description
Returns the second derivative of the shape at a point between 0 and 1. This is particularly useful for determining force() in a Tween.
Example
import megamu.shapetween.*;

Shaper cosine;

void setup(){
  size(200,200);
  cosine = new CosineShaper(Shaper.IN);
}

void draw(){
  background(255);

  beginShape();
  for( float i=0; i<=1; i+= 0.05 )
    vertex( i*width, cosine.shape( i )*height );
  endShape();

  beginShape();
  for( float i=0; i<=1; i+= 0.05 )
    vertex( i*width, cosine.slope( i )*height );
  endShape();

  stroke(255,0,0);
  float x = norm( mouseX, 0, width );
  float y = cosine.shape( x );
  float m = cosine.slope( x );
  float n = cosine.secondSlope( x );

  line(width*(x-1), height*(y-m), width*(x+1), height*(y+m));
  line(width*(x-1), height*(m-n), width*(x+1), height*(m+n));
}
Syntax
secondSlope(in)
Parameters
in
float: A number between 0 and 1
Related
slope()
shape()
force()