evolve

The default evolution from the start to the end parameters of an object is linear, i.e.
$value = $start + $t*($end - $start)
where $t evolves uniformly from 0 to 1 during the active interval of an object.

However, aximate allows you to modify this evolution by specifying the function of $t according to which a certain option should evolve. This is done by providing a second (referenced) hash to the object. For example, a jumping ball can be represented as:

    point({"coordinates" => [[-100,-50],[0,100]],
	  "interval" => [0,50]},
	  {"coordinates" => ['$t','(1-$t)**2']});
    point({"coordinates" => [[0,100],[100,-50]],
	  "interval" => [50,100]},
	  {"coordinates" => ['$t','$t**2']});
... or, with a do-loop ...
    $num = 10;
    $norm = 0;
    foreach $i (1..$num) {
	$norm += 1/sqrt(2**$i);
    }
    $bound1 = 0;
    $bound2 = 0;
    foreach $i (1..$num) {
	$bound2 += 100/$norm/sqrt(2**$i);
	$bound3 = $bound1 + 100/$norm/sqrt(2**$i)/2;
	point({"coordinates" => [[0,-50],[0,100/2**($i-1)-50]],
	       "interval" => [$bound1,$bound3]},
	      {"coordinates" => ['$t','(1-$t)**2']});
	point({"coordinates" => [[0,100/2**($i-1)-50],[0,-50]],
	       "interval" => [$bound3,$bound2]},
	      {"coordinates" => ['$t','$t**2']});
	$bound1 = $bound2;
    }
}
A few remarks: let us assume that f($t) is the evolution function.
  • If both the $start and the $end value is given, and f(1)f(0), the evolution function is scaled so that $start and $end are reached:
        evol($t) = $start + (f($t)-f(0))/(f(1)-f(0))*($end-$start)
      
  • If both the $start and the $end value is given, and f(1) = f(0), a linear function is added so that $start and $end are reached:
        evol($t) = f($t) - f(0) + $start + $t*($end-$start)
      
    Note that this means that even if f($t) = const, the values will evolve linearly from the $start to the $end.
  • If the $end value is missing, it is assumed to be equal to the $start value.
  • If the $end value is given but empty (i.e. []), and the $start value is given and not empty, the evolution function is
        evol($t) = $start + f($t) - f(0)
      
  • If the $start value is given but empty (i.e. []), and the $end value is given and not empty, the evolution function is
        evol($t) = $end + f($t) - f(1)
      
  • If both the $start and the $end value is given but empty (i.e. []), the evolution function is
        evol($t) = f($t)
      
As an example, consider
    point({"coordinates" => [[],[]]},
	  {"coordinates" => ['100*cos(2*pi*$t)','100*sin(2*pi*$t)']});
NB: Note that the same result can be achieved through
  point({"coordinates" => [[0,0]],
        "polar" => [[100,0],[100,360]]})
main