Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

**First time visiting? Here are some places to start:**

- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

# Equation-driven curve

Edward_Goodwin
Member Posts:

**25**PRO
in General

Hi, is there any way to create an equation-driven curve? I've searched a bit on-line but can't seem to find something that does what I'd like. I'm looking to create a curve which follows a mathematical formula. It could be either polar or cartesian - doesn't matter which.

All thoughts gratefully received

Edward

All thoughts gratefully received

Edward

0

## Comments

11725PROIs that a feature available in Onshape?

978117https://cad.onshape.com/documents/9f37c17aa964f1f4f3bc7bf1/w/dc8b4abdb015d5cc66bfd1f7/e/8622366028535ec6b660fd28

25PRO25PRO978if I simply want to define x as a function of y, do I still have to use the independent parameter? Also, as I only want a 2d curve, I presume I simply make z=0mm (to draw on the top plane).

964✭✭✭✭25PROAlso, slightly unrelated to the (simple) maths that I'm failing to be do right now(!) is it possible to draw the parametric curve in a sketch as opposed to creating an independent curve? Or do I have to offset entities/use the curve within a new sketch? If so, the offset curve within the sketch doesn't appear to update if the parametric curve is modified. Is that correct?

Next, in your examples for the parametric curve feature, the actual curve functions appear to be hidden - I can't simply double-click the feature within the document to understand how you've set up the functions. Is that something that I can access (i.e. am I doing something wrong?) or is it hidden on purpose?

Finally, just so you know, Cartesian is spelt with an 'a' not an 'o' (you have 'Cartesion' in the feature script ;-)

Thanks for all your help!

Edward

9781. Not knowing if #t is in degrees or radians is precisely why it returns an error. Use cos(#t deg) or cos(#t rad). Also, you need to write out multiplication explicitly: a * cos(#t deg)

2. You can't draw a parametric curve in a sketch, but once you have it separately, you can reference it from a sketch -- project it and then you can offset it.

3. You can't see the functions in the example document because you don't have write access to the document (we're actually working on fixing that so you can see the expressions) -- for now, make a copy of the workspace for yourself and you'll be able to see the functions there.

964✭✭✭✭As for spherical/cylindrical coordinate systems, they're very handy and intuitive once you know how to use them. Instead of linear XYZ positions, you can use one or more angles instead - R/Theta/Z for cylindrical and R/Theta/Phi for spherical. For example, your circle is much easier in cylindrical coordinates. No messy trig functions - at least not that you can see. All the trig happens behind the scenes.

Cartesian Cylindrical

X=r*cos(#t deg) R=2*r

Y=r*sin(#t deg) Th=#t

26✭✭--Thank you Paul for the example file! This was a helpful contributionI was able to get a coshx curve usingCan I copy it into a sketch and then transform/scale it?964✭✭✭✭