[ Launch: SVG Path Test 1 ] 4721079 by roundrobin
[ Launch: SVG Path Element ] 4721053 by roundrobin
[ Launch: Bootstrap Trib ] 4711978 by roundrobin
[ Launch: Tributary inlet ] 4711690 by roundrobin
-
-
Save roundrobin/4721079 to your computer and use it in GitHub Desktop.
SVG Path - spring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"SVG Path - spring","endpoint":"","display":"svg","public":true,"require":[{"name":"Helpers","url":"https://raw.github.com/roundrobin/svg-path-generator/master/svg-path-generator.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"fullscreen":false,"thumbnail":"http://i.imgur.com/qxlvidb.png"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var svg = d3.select("svg"); | |
//Uses the svg-path-generator class | |
//https://github.com/roundrobin/svg-path-generator | |
var path = new Path(svg) | |
path.add(['m',200,100]); | |
var a = 0; | |
var b = 0; | |
Math.abs(a) // the absolute value of a | |
Math.acos(a) // arc cosine of a | |
Math.asin(a) // arc sine of a | |
Math.atan(a) // arc tangent of a | |
Math.atan2(a,b) // arc tangent of a/b | |
Math.ceil(a) // integer closest to a and not less than a | |
Math.cos(a) // cosine of a | |
Math.exp(a) // exponent of a (Math.E to the power a) | |
Math.floor(a) // integer closest to a, not greater than a | |
Math.log(a) // log of a base e | |
Math.max(a,b) // the maximum of a and b | |
Math.min(a,b) // the minimum of a and b | |
Math.pow(a,b) // a to the power b | |
Math.random() // pseudorandom number 0 to 1 (see examples) | |
Math.round(a) // integer closest to a (see rounding examples) | |
Math.sin(a) // sine of a | |
Math.sqrt(a) // square root of a | |
Math.tan(a) // tangent of a | |
var l = 14; | |
var x,y; | |
for(var i=0; i < 9;i++){ | |
x = Math.abs(i)*l; | |
y = 10*Math.sin(i/0.00000000001)*l; | |
path.add(['l',x,y]); | |
} | |
path.render(); | |
path.showPoints() | |
path.hidePoints() | |
path.scale(3) | |
console.log(path.el().node().pathSegList) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment