Skip to main content
1-Visitor
February 2, 2012
Question

Equations for Curves (and more)

  • February 2, 2012
  • 19 replies
  • 75842 views

I wish I had found a list like this a few years ago.  I've searched the web and compiled the following list for your enjoyment.  Many are probably considered basic with a few very cool, complex curves thrown in.  The list is divided into the coordinate systems that you will have to choose when creating the datum curve.

To initiate the command that will allow you to try these, go to Insert>Model Datum>Curve>From Equation. 

After the Equations section see the section title Links to find PlanetPTC discussions and videos that have demonstrated and, in some cases, explained the curve from equation command in more detail with ways to incorporate relations and parameters.

Attached is a Creo Elements/Pro 5.0 part file with all of the equations included.

In the comments, please share any equations or links that you know.  Other suggestions are welcome, too.

EQUATIONS

Cartesian Coordinates:  x, y, & z

The z variable is not necessary, but when used will give the curve that extra dimension. If in doubt, try z = t*10.

Sine

Cartesian coordinates

x = 50 * t

y = 10 * sin (t * 360)

Rhodonea

Cartesian coordinates

theta = t * 360 * 4

x = 25 + (10-6) * cos (theta) +10 * cos ((10/6-1) * theta)

y = 25 + (10-6) * sin (theta) - 6 * sin ((10/6-1) * theta)

Involute

Cartesian coordinates

r = 1

ang = 360 * t

s = 2 * pi * r * t

x0 = s * cos (ang)

y0 = s * sin (ang)

x = x0 + s * sin (ang)

y = y0-s * cos (ang)

Logarithmic

Cartesian coordinates

z = 0

x = 10 * t

y = log (10 * t +0.0001)

Double Arc Epicycloid

Cartesian coordinate

l = 2.5

b = 2.5

x = 3 * b * cos (t * 360) + l * cos (3 * t * 360)

Y = 3 * b * sin (t * 360) + l * sin (3 * t * 360)

Star Southbound

Cartesian coordinate

a = 5

x = a * (cos (t * 360)) ^ 3

y = a * (sin (t * 360)) ^ 3

Leaf

Cartesian coordinates

a = 10

x = 3 * a * t / (1 + (t ^ 3))

y = 3 * a * (t ^ 2) / (1 + (t ^ 3))

Helix

Cartesian coordinates

x = 4 * cos (t * (5 * 360))

y = 4 * sin (t * (5 * 360))

z = 10 * t

Parabolic

Cartesian coordinates

x = (4 * t)

y = (3 * t) + (5 * t ^ 2)

z = 0

Eliptical Helix

Cartesian coordinates

X = 4 * cos (t * 3 * 360)

y = 2 * sin (t * 3 * 360)

z = 5

Disc Spiral 1

Cartesian coordinates

/* Inner Diameter

d = 10

/* Pitch

p = 5

/* Revolutions

r = 5

/* Height; use 0 for a 2D curve

h = 0

x = ((d/2 + p * r * t) * cos ((r * t) * 360))

y = ((d / 2 + p * r * t) * sin ((r * t) * 360))

z = t * h

Butterfly

a=cos(t*360)

b=sin(t*360)

c=cos(4*t*360)

d=(sin((1/12)*t*360))^5

x=b*(exp(a)-2*c+d)

y=a*(exp(a)-2*c+d)

Fish

a = cos (t * 360)

b = sin (t * 360)

/* As "c" increases the fish gets fatter until it transforms into a figure 8.

c = 10

x = (C*a-20*((b)^2)/1.5)

y = c * a * b

Cappa

/* "c" is a scaling variable

c=20

/* Revolutions

r=1

/* Height

h=0

x=c*cos(t*r*360)*sin(t*r*360)

y=c*cos(t*r*360)

z=t*h

Star

/* "a" & "b" are scaling variables

a=2

b=2

/* If, r=2/3 ----> astroid

/* If, r=2 ----> ellipse; when a=b, its a circle

/* r cannot equal 1

r=2/3

x=a*(cos(t*360))^(2/r)

y=b*(sin(t*360))^(2/r)

z=0

Bicorn

/* "c" is a scaling variable.

c=5

a=cos(t*360)

b=sin(t*360)

x=c*a

y=c*(a^2)*(2+a)/(3+b^2)

Talbots

/* "c" is a scaling variable.

c=10

a=cos(t*360)

b=sin(t*360)

x=C*a*(1+exp(2)*(b^2))

y=C*b*(1+exp(2)*(b^2))

Cylindrical Coordinates:  r, theta, & z

Spiral

Cylindrical coordinates

r = t

theta = 10 + t * (20 * 360)

z = t * 3

Circle Spiral Column

Cylindrical coordinates

theta = t * 360

r = 10 +10 * sin (6 * theta)

z = 2 * sin (6 * theta)

Helical Wave

Cylindrical coordinates

r = 5

theta = t * 3600

z = (sin (3.5 * theta-90)) +24 * t

Basket

Cylindrical coordinates

r = 5 + 0.3 * sin (t * 180) + t

theta = t * 360 * 30

z = t * 5

Disc Spiral 2

Cylindrical coordinates

R = 50 + t * (120)

Theta = t * 360 * 5

Z = 0

Apple

Cylindrical coordinates

a = 10

r = a * (1 + cos (theta))

theta = t * 360

 

Spherical Coordinates:  rho, theta, & phi

Butterfly Ball

Spherical coordinates

rho = 8 * t

theta = 360 * t * 4

phi = -360 * t * 8

Spherical Helix

Spherical coordinates

rho = 4

theta = t * 180

phi = t * 360 * 20

UFO

Spherical coordinates

rho = 20 * t ^ 2

theta = 60 * log (30) * t

phi = 7200 * t

Unnamed

Spherical coordinates

rho = 200 * t

theta = 900 * t

phi = t * 90 * 10

 
 

LINKS

Peruse the links for more equations and explanations as to how they work.

Web Links

  1. Involute Gears
  2. Power Tools: Curves by Equation
    1. This gives details about using Pro/E dimension references in the equation to give it a parametric touch.

Links to curve-from-equation Discussions on PlanetPTC:

  1. Curve from Equation Sample for Newbies
  2. Capto
  3. How to Create a Curve from the Equation? Does Anybody Know?
  4. Datum Curve from Equation Driven by Parameters
  5. Constant Force Spring Model
  6. Involute Helical Gear Geometry

Links for related PlanetPTC content:

If you think curves from equations are cool, then the following is right up your alley.  These delve into the use of variable section sweep and the trajpar variable.


  1. From E-learning with Vladimir Palffy
    1. http://communities.ptc.com/blogs/vpalffy/2011/02/09/user-defined-springs
    2. http://communities.ptc.com/blogs/vpalffy/2011/11/27/sweep-and-trajpar
  2. Fun with Helical Sweeps and Trajpar
  3. Conch Shell in Creo Parametric
  4. How to Create Twisted Wires

19 replies

1-Visitor
April 11, 2015

thanks lot finally i got about the equation for curves

12-Amethyst
June 7, 2016

Hello,

do you know whether it is possible to split the range of t into multiple intervals?

for example I would like to set:

for 0<t<0.5

x=0

y=t

for 0.5<t<1

x=t

y=t^2

I would really need this because if I build these two pieces with two separate curves and then merge them with the "Copy - evaluation" command, any sketch projecting the unified curve will always see it as two separate pieces and this causes me problems in sketch references when the curves themselves change.

thanks

bye

23-Emerald IV
June 13, 2016

Short answer, no.  You can create the IF statements for the different ranges but they do not get evaluated correctly.

Long answer from PTC:

"The relation for trajpar does not support ranges (changes of function on different pieces of the trajectory, implemented with 'if' statements). Suggested using multiple variable section sweep features, with family tables, or defining geometrical breaks in the trajectory."

1-Visitor
June 13, 2016

Not really sure what's "Copy - evaluation" command, but try searching for a term "Composite curve".

12-Amethyst
June 15, 2016

Hello Tom,

thanks for your tip. What do you exactly mean with "they do not get evaluated correctly"?.

Also, how could I define geometrical breaks ? by trimming the curve?

bye

12-Amethyst
June 15, 2016

Hello James,

with Copy-Evaluation I was meaning the action of selecting the curve (which highlights in green), Ctrl+C, then Ctrl+V and the copy evaluation menu opens (where you can add more curves to the copied one).

Bye

23-Emerald IV
June 15, 2016

What do you exactly mean with "they do not get evaluated correctly"?

Well, I'm not a developer but from what I can tell the curve generator dynamically adjusts how many locations it needs to evaluate 't' for based on the results of the previous evaluations.  It will progressively reduce the step size (down to some minimum) until it meets some type of fitting criteria.  I don't know the exact algorithm, but if the first section of the curve uses an equation that makes it flat, then the entire curve will end up flat, regardless of what the equation for the other sections might be.

how could I define geometrical breaks ? by trimming the curve?

Yes, exactly.

1-Visitor
March 9, 2018

Hi

Thank you so much for your web site

I want to plot NACA Aifoil by this equation but I can not view the Cure in PTC Creo Parametric?!

M=0.08
a0=0.2969
a1=0.126
a2=0.3516
a3=0.2843
a4=0.1015
T=0.12
p=0.4
x=t-((T/.2)*((a0*t^.5)-(a1*t)-(a2*t^2)+(a3*t^3)-(a4*t^4)))*(Sin(360*atan((M/p^2)*(2*p-2*t))))
y=((M/p^2)*(2*p*t-t^2))+((T/.2)*((a0*t^.5)-(a1*t)-(a2*t^2)+(a3*t^3)-(a4*t^4)))*(Cos(360*atan((M/p^2)*(2*p-2*t))))
z=0

1-Visitor
March 9, 2018

M=0.08
a0=0.2969
a1=0.126
a2=0.3516
a3=0.2843
a4=0.1015
T=0.12
p=0.4
x=t-((T/.2)*((a0*t^.5)-(a1*t)-(a2*t^2)+(a3*t^3)-(a4*t^4)))*(Sin(atan((M/p^2)*(2*p-2*t))))
y=((M/p^2)*(2*p*t-t^2))+((T/.2)*((a0*t^.5)-(a1*t)-(a2*t^2)+(a3*t^3)-(a4*t^4)))*(Cos(atan((M/p^2)*(2*p-2*t))))
z=0