# Default Segment Type Function Definitions

`'`
`'------------- Cubic -------------------`
`'`
`SegmentType("Cubic", x, x1, y1, x2, y2)`
`     xbar = (x-x1)/(x2-x1);`
`     ybar = 3*xbar^2 - 2*xbar^3;`
`     y = y1+(y2-y1)*ybar;`
`     return y;`
`endSegmentType`
`'`
`'------------- Quarter Sine ------------`
`'`
`SegmentType("Quarter-Sine", x, x1, y1, x2, y2)`
`     xbar = (x-x1)/(x2-x1);`
`     ybar = sin(PI*xbar/2);`
`     y = y1+(y2-y1)*ybar;`
`     return y;`
`endSegmentType`
`'`
`'------------- Quarter Cosine ------------`
`'`
`SegmentType("Quarter-Cosine", x, x1, y1, x2, y2)`
`     xbar = (x-x1)/(x2-x1);`
`     ybar = 1-cos(PI*xbar/2);`
`     y = y1+(y2-y1)*ybar;`
`     return y;`
`endSegmentType`
`'`
`'------------- Half Cosine ----------------`
`'`
`SegmentType("Half-Cosine", x, x1, y1, x2, y2)`
`     xbar = (x-x1)/(x2-x1);`
`     ybar = cos(PI*xbar);`
`     y = (y2+y1)/2-((y2-y1)/2)*ybar;`
`     return y;`
`endSegmentType`
`'`
`'------------- 3-4-5 Polynomial ----------------`
`'`
`SegmentType("3-4-5-Polynomial", x, x1, y1, x2, y2)`
`     xbar = (x-x1)/(x2-x1);`
`     ybar = 10*xbar^3 - 15*xbar^4 + 6*xbar^5;`
`     y = y1+(y2-y1)*ybar;`
`     return y;`
`endSegmentType`
`'`
`'------------- 4-5-6-7 Polynomial -------------`
`'`
`SegmentType("4-5-6-7-Polynomial", x, x1, y1, x2, y2)`
`     xbar = (x-x1)/(x2-x1);`
`     ybar = 35*xbar^4 - 84*xbar^5 + 70*xbar^6 - 20*xbar^7;`
`     y = y1+(y2-y1)*ybar;`
`     return y;`
`endSegmentType`
`'`
`'------------- 5-6-7-8-9 Polynomial -------------`
`'`
`SegmentType("5-6-7-8-9-Polynomial", x, x1, y1, x2, y2)`
`     xbar = (x-x1)/(x2-x1);`
`     ybar = 126*xbar^5 - 420*xbar^6 + 540*xbar^7 - 315*xbar^8 + 70*xbar^9;`
`     y = y1+(y2-y1)*ybar;`
`     return y;`
`endSegmentType`
`'`
`'------------- Cycloidal ----------------`
`'`
`SegmentType("Cycloidal", x, x1, y1, x2, y2)`
`     xbar = (x-x1)/(x2-x1);`
`     ybar = 1-cos(PI*xbar/2);`
`     y = y1+(y2-y1)*ybar;`
`     return y;`
`endSegmentType`
`'`
`'------------- Quadratic -------------------`
`'`
`SegmentType("Quadratic", x, x1, y1, x2, y2)`
`     xbar = (x-x1)/(x2-x1);`
`     ybar = xbar2;`
`     y = y1+(y2-y1)*ybar;`
`     return y;`
`endSegmentType`
`'`
`'------------- Linear -------------------`
`'`
`SegmentType("Linear", x, x1, y1, x2, y2)`
`     slope = (y2-y1)/(x2-x1);`
`     dy = slope*(x-x1);`
`     val = y1 + dy;`
`     return val;`
`endSegmentType`

Provide feedback on this topic

* Required

 *Email: Subject: Feedback on Help Topics Page: Default Segment Type Function Definitions *Comment: * I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

Never show this message again
x

Web Help Content Version: SOLIDWORKS 2016 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.