2 * Portions of this file are based on pieces of Yahoo User Interface Library
3 * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
4 * YUI licensed under the BSD License:
5 * http://developer.yahoo.net/yui/license.txt
6 * <script type="text/javascript">
9 Roo.lib.Bezier = new function() {
11 this.getPosition = function(points, t) {
12 var n = points.length;
15 for (var i = 0; i < n; ++i) {
16 tmp[i] = [points[i][0], points[i][1]];
19 for (var j = 1; j < n; ++j) {
20 for (i = 0; i < n - j; ++i) {
21 tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
22 tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
26 return [ tmp[0][0], tmp[0][1] ];