Mobile app version of vmapp.org
Login or Join
Fox8063795

: Programmatic swirl function In the following post @joojaa writes out the math function for the artwork shown here: His code is specifically in PostScript, which is awesome...but I'm wondering

@Fox8063795

Posted in: #AdobeIllustrator #IllustratorScripting #Javascript #Mathematics

In the following post @joojaa writes out the math function for the artwork shown here:



His code is specifically in PostScript, which is awesome...but I'm wondering if this can't be converted to Javascript specifically to be written as an Illustrator script. I've tried it myself with no luck.


var t = 1000; //not sure what 't' should be other than a number
var e = a.pathItems.ellipse(20*Math.cos(t)-10*Math.sin(5*t+Math.PI/2), 20*Math.sin(t)+10*Math.cos(5*t+Math.PI/2));
e.stroked = true;
e.filled = false;


The code actually does generate an ellipse but its def not correct.


Any ideas on how to draw a math function for Illustrator using scripting?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Fox8063795

1 Comments

Sorted by latest first Latest Oldest Best

 

@Kimberly620

I assume that this question is addressed at me. No, it isn't PostScript, its just a function I didn't claim otherwise (i mean pots script as in 'appended'). See GD.SE does not support LaTex so I use the next best thing, code.

You can drop the function into any function graphing utility you have. But if you dont have anything useful you can find one that I made for Illustrator users here (it is called jooGraphFunction), documentation can be found here with examples. Unfortunately there are infinite number of functions so I cannot cover entire math spectrum. But just as a tip Wikipedia contains quite a lot of examples.



Image 1 Graph the function (and rotate by 45 degrees)

Dont worry everything can be misunderstood. :)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme