Shaper::slope()
Description
Returns the slope of the shape at a point between 0 and 1. This is particularly useful for determining speed() 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();

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

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