/* DynAPI Distribution Glide Animation Extension The DynAPI Distribution is distributed under the terms of the GNU LGPL license. requires: dynapi.fx.Thread */ function GlideAnimation(x1,y1,x2,y2,angleinc,startSpeed,endSpeed) { if (x2==null) x2 = x1; if (y2==null) y2 = y1; var normAngle = dynapi.functions.getNormalizedAngle(x1,y1,x2,y2); var distx = x2-x1; var disty = y2-y1; var distance = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2)); angleinc = (angleinc==null)? 7 : Math.abs(angleinc); // a terrible mess but it works var r = 1; if (startSpeed == "fast") { var centerX = x1; var centerY = y1; var centerX2 = x2; var centerY2 = y2; startAngle = 0; endAngle = 90; if (endSpeed=="fast") distance = distance/2; } else { startAngle = -90; endAngle = 0; if (endSpeed == "fast") { var centerX = x1+distx; var centerY = y1+disty; } else { // default slow,slow var centerX2 = x2-distx/2; var centerY2 = y2-disty/2; distance = distance/2; var centerX = x1+distx/2; var centerY = y1+disty/2; r = -1; } } var i,d,x,y,dx,dy,path=[]; for (var a=startAngle; a