add cube quartic euqation
This commit is contained in:
72
demo/js/math.js
Normal file
72
demo/js/math.js
Normal file
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* @file math.js
|
||||
* @author mengke01
|
||||
* @date
|
||||
* @description
|
||||
* 方程运算
|
||||
*/
|
||||
|
||||
define(
|
||||
function(require) {
|
||||
|
||||
var quadraticEquation = require('math/quadraticEquation');
|
||||
var cubeEquation = require('math/cubeEquation');
|
||||
var quarticEquation = require('math/quarticEquation');
|
||||
|
||||
var bezierQuadraticEquation = require('math/bezierQuadraticEquation');
|
||||
var bezierCubeEquation = require('math/bezierCubeEquation');
|
||||
var bezierQuarticEquation = require('math/bezierQuarticEquation');
|
||||
|
||||
var entry = {
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
init: function () {
|
||||
|
||||
|
||||
console.log(quadraticEquation(1, 0, 1));
|
||||
console.log(bezierQuadraticEquation(1, 0, 1));
|
||||
console.log('--------------------------------');
|
||||
console.log(quadraticEquation(1, -2, 1));
|
||||
console.log(bezierQuadraticEquation(1, -2, 1));
|
||||
console.log('--------------------------------');
|
||||
|
||||
|
||||
|
||||
|
||||
console.log(cubeEquation(1, 0, 0, 1));
|
||||
console.log(bezierCubeEquation(1, 0, 0, 1));
|
||||
console.log('--------------------------------');
|
||||
console.log(cubeEquation(1, 0, 0, -1));
|
||||
console.log(bezierCubeEquation(1, 0, 0, -1));
|
||||
console.log('--------------------------------');
|
||||
|
||||
|
||||
|
||||
|
||||
console.log(quarticEquation(1, 0, 0, 0, 1));
|
||||
console.log(bezierQuarticEquation(1, 0, 0, 0, 1));
|
||||
console.log('--------------------------------');
|
||||
console.log(quarticEquation(1, 0, 0, 0, -1));
|
||||
console.log(bezierQuarticEquation(1, 0, 0, 0, -1));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
entry.init();
|
||||
|
||||
return entry;
|
||||
}
|
||||
);
|
||||
25
demo/math.html
Normal file
25
demo/math.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>测试render</title>
|
||||
<script src="http://s1.bdstatic.com/r/www/cache/ecom/esl/1-8-2/esl.js"></script>
|
||||
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
require.config({
|
||||
baseUrl: '../src',
|
||||
paths: {
|
||||
demo: '../demo/js',
|
||||
}
|
||||
});
|
||||
define('jquery', $);
|
||||
</script>
|
||||
|
||||
<script>
|
||||
require(['demo/math']);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user