Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding tangent at Spline Function

Status
Not open for further replies.

seregag

Industrial
Jan 1, 2006
2
Hello.
I have some piecewise polynomial (pp).
And I have to find a point with tangent = 45'.
How can I do it using built function in Spline ToolBox.
Thanks
 
Replies continue below

Recommended for you

To define a tangent line you need a point and a slope.

Let's say on the interval of interest the function is quadratic
y(x) = ax^2 + bx + c
y(45) = a*45^2 + b*45 + c
That is a point

dy/dx = 2ax + b
dy/dx(x=45) = 2*a*45 + b
That is a slope


=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
I'm sorry, I thought you were looking for tangent at x=45 (easy problem).

Are you looking for a point with slope of 1 (45 degrees from axis)?

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
yes, 45 degrees from axis
thanks
 
You want an angle 45 degrees from axis (assuming x and y axis are 1:1 ratio). That corresponds to slope = +1 or -1.

Again assuming a quadratic fit...

y(x) = ax^2 + bx + c
dy/dx = 2ax + b

For dy/dx = 1
dy/dx = 2ax + b = 1
x = (1-b)/(2a)

For dy/dx = -1
dy/dx = 2ax + b = -1
x = (-1-b)/(2a)

Calculate the x for each of these and see if it falls within the interval that the quadratic is valid for. If it is, then it is a point with 45 degree angle slope. If both solutions (for slope = 1 and slope=-1) are outside of the interval that the quadratic is defined for, then there is no 45-degree slope in that interval.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor