/** * jquery roundabout shapes v2 * http://fredhq.com/projects/roundabout-shapes/ * * provides additional paths along which items can move for the * jquery roundabout plugin (v1.0+). * * terms of use // jquery roundabout shapes * * open source under the bsd license * * copyright (c) 2009-2011, fred leblanc * all rights reserved. * * redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * - neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * this software is provided by the copyright holders and contributors "as is" * and any express or implied warranties, including, but not limited to, the * implied warranties of merchantability and fitness for a particular purpose * are disclaimed. in no event shall the copyright holder or contributors be * liable for any direct, indirect, incidental, special, exemplary, or * consequential damages (including, but not limited to, procurement of * substitute goods or services; loss of use, data, or profits; or business * interruption) however caused and on any theory of liability, whether in * contract, strict liability, or tort (including negligence or otherwise) * arising in any way out of the use of this software, even if advised of the * possibility of such damage. */ jquery.extend(jquery.roundaboutshapes, { thejuggler: function(r, a, t) { return { x: math.sin(r + a), y: math.tan(math.exp(math.log(r)) + a) / (t - 1), z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, figure8: function(r, a, t) { return { x: math.sin(r * 2 + a), y: (math.sin(r + math.pi/2 + a) / 8) * t, z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, waterwheel: function(r, a, t) { return { x: (math.sin(r + math.pi/2 + a) / 8) * t, y: math.sin(r + a) / (math.pi/2), z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, square: function(r, a, t) { var sq_x, sq_y, sq_z; if (r <= math.pi/2) { sq_x = (2/math.pi) * r; sq_y = -(2/math.pi) * r + 1; sq_z = -(1/math.pi) * r + 1; } else if (r > math.pi/2 && r <= math.pi) { sq_x = -(2/math.pi) * r + 2; sq_y = -(2/math.pi) * r + 1; sq_z = -(1/math.pi) * r + 1; } else if (r > math.pi && r <= (3 * math.pi) / 2) { sq_x = -(2/math.pi) * r + 2; sq_y = (2/math.pi) * r - 3; sq_z = (1/math.pi) * r - 1; } else { sq_x = (2/math.pi) * r - 4; sq_y = (2/math.pi) * r - 3; sq_z = (1/math.pi) * r - 1; } return { x: sq_x, y: sq_y * t, z: sq_z, scale: sq_z }; }, conveyorbeltleft: function(r, a, t) { return { x: -math.cos(r + a), y: (math.cos(r + 3*math.pi/2 + a) / 8) * t, z: (math.sin(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, conveyorbeltright: function(r, a, t) { return { x: math.cos(r + a), y: (math.cos(r + 3*math.pi/2 + a) / 8) * t, z: (math.sin(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, goodbyecruelworld: function(r, a, t) { return { x: math.sin(r + a), y: (math.tan(r + 3*math.pi/2 + a) / 8) * (t + 0.5), z: (math.sin(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, diagonalringleft: function(r, a, t) { return { x: math.sin(r + a), y: -math.cos(r + math.tan(math.cos(a))) / (t + 1.5), z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, diagonalringright: function(r, a, t) { return { x: math.sin(r + a), y: math.cos(r + math.tan(math.cos(a))) / (t + 1.5), z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, rollercoaster: function(r, a, t) { return { x: math.sin(r + a), y: math.sin((2 + t) * r), z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, teardrop: function(r, a, t) { return { x: math.sin(r + a), y: -math.sin(r/2 + t) + 0.35, z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, tickingclock: function(r, a, t) { return { x: math.cos(r + a - math.pi/2), y: math.sin(r + a - math.pi/2), z: math.cos(r), scale: math.cos(r) + 0.5 } }, flurry: function(r, a, t) { return { x: math.sin(r * 3 + a), y: (math.cos(r + math.pi/2 + a) / 2) * t, z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, nowslide: function(r, a, t) { return { x: math.tan(r * 2 + a) * 0.5, y: math.cos(r*2 + t) / 6, z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; }, risingessence: function(r, a, t) { return { x: math.sin(r + a), y: math.tan((2 + t) * r), z: (math.cos(r + a) + 1) / 2, scale: (math.sin(r + math.pi/2 + a) / 2) + 0.5 }; } });