Thursday 15 March 2012

javascript - Raphael.js irregular path around a center point -


I have a focal point with every 18 digit 20deg outgoing. I will point any point from any point of the next path How to overcome the path, all the way around. As the center starts out from 20px at 0deg, then pulls 40px out at 20deg, then pulls 100px out at 40deg, etc.

I started going down some paths (sorry) but nothing can be found in what I have to do (at least not clearly) I thought maybe found point Atlanta answer Will be there, but could not go there.

Define the path in which you specify the string, in which some trigonometry will be required Take that you have an array of (cx, cy) and radius:

  var command = 'm'; Var radii = [20, 40, 100, ...]; Var cx = 200; Var cy = 200; For (var i = 0; i & lt; 18; i ++) {var theta = mathematics.pi * i / 9; Var x = cx + redi [i] * math kos (theta); Var y = cy + radii [i] * monastery; sin (theta); Command + = x + '' + y + ''; } Var p = paper.path (command);    

No comments:

Post a Comment