How to make true parabolas in Adobe Illustrator

Today, a post of technology and activities.

A Google search for making a parabola brought me to a nice quick article on making a parabola-looking curved line on eHow.com, but for a quick half-day project I am needing to draw a perfect and scalable vector.

Attached is a simple script to run in Adobe Illustrator that was hand-typed to build what is needed for my project.  Some convenient Javascript prompts are included to make it easy to use.

In illustrator, press Ctrl+F12 on Windows or Cmd+F12 on Mac or click File > Scripts > Other script and load the file, then read and follow the prompts.

Here are two parabolas made with this script:

This entry was posted in Technology. Bookmark the permalink.

5 Responses to How to make true parabolas in Adobe Illustrator

1. Deborah says:

Thanks…just what I was looking for. This is very handy!

2. Waynos! says:

Legend! Thank you so much. <3

ps.. 'Surprised there are not more comments after 3 years. How many downloads in this period all-told?

3. Muhammad Umar Hassan says:

I’ve made it a little more useful for those who want more control over what are the parameters of the parabola:

alert(“The parabola will be generated according to this equation. \ny = a * (x – xOffset)^2 + b * (x – xOffset) + yOffset”);
xpos = parseFloat(prompt(“X offset”, “0”));
ypos = parseFloat(prompt(“Y offset”, “0”));
a = parseFloat(prompt(“Coefficient a”, “1”));
b = parseFloat(prompt(“Coefficient b”, “0”));
xstart = parseFloat(prompt(“First Value of X”, “-0.5”));
xend = parseFloat(prompt(“Last Value of X”, “0.5”));
steps = parseFloat(prompt(“How many steps should be there?”, 100) );
scale = parseFloat(prompt(“What should be the scale”, 400));
strokewidth = 1;
drawParabola(xpos, ypos, a, b, xstart, xend, steps, strokewidth, scale);
redraw();

function drawParabola(xpos, ypos, a, b, xstart, xend, steps, strokewidth, scale)
{
var increment = (xend -xstart) / steps;
var myDoc = app.activeDocument;//.documents.add();
var myParabolaPath = myDoc.pathItems.add();
myParabolaPath.stroked = true;
myParabolaPath.strokeWidth = strokewidth;
myParabolaPath.filled = false;
if (xstart > xend)
{
var tx = xstart;
xstart = xend;
xend = tx;
}
var newPoint;
for (i = xstart; i <= xend; i+= increment)
{
4. Tyler says: