[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
If you have two arbitrary points on the x-y plane, each with
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 21
Thread images: 2
File: pls halp.png (51 KB, 800x800) Image search: [Google]
pls halp.png
51 KB, 800x800
If you have two arbitrary points on the x-y plane, each with known first derivatives, what is the equation of the interpolating curve between those two points such that it starts and ends at the specified slopes?
>>
Plot the derivatives and find a function that goes through the two derivative values. Take the integral of this function and find c such that the integral equation goes through one of the original points given.
>>
>>8010463
f'(x) = (f'(a)-f'(b))/(a-b) (x-a) + f'(a)
>>
>>8010463
>Plot the derivatives and find a function that goes through the two derivative values.
But that's just restating the problem. What is the function?
>>
>>8010474
Meant to reply to>>8010470
>>
>>8010474
No it's not. The problem is to graph a function f(x) with the slopes given. Graph the slopes as values of a new function, f'(x). The simplest function through two points is a line. So define f'(x) as a line which goes through f'(a) and f'(b). This is >>8010472

Now we take the integral of f'(x)
>>
>>8010463
You want to use Newton's divided differences interpolation polynomial. To include derivatives, repeat the points and plug in the derivate f'(xi) for (f(xi)-f(xi))/(xi-xi)
https://en.wikipedia.org/wiki/Newton_polynomial
>>
>>8010463
f(x) = f(a)+(x-a)((x+a-2b)f'(a)-(x-a)f'(b))/(2(a-b))
>>
>>8010463
It can be pretty much anything really, it could be a squiggly wiggly, it could morph into a sign wave.

However, from your description, you probably want to use a cubic spline.

I would suggest reading up on C1 continuity though:
https://en.wikipedia.org/wiki/Smoothness
>>
>>8010490

y(x) = y1 + y'1 (x-x1) + [(y2-y1)/(x2-x1) - y'1]/(x2-x1) (x-x1)^2 + [y'2+y'1 - 2(y2-y1)/(x2-x1)]/(x2-x1)^2 (x-x1)^2(x-x2)
>>
>>8010510
Mine's better.

f(x) = f(a)+(x-a)((x+a-2b)f'(a)-(x-a)f'(b))/(2(a-b))
>>
File: 1450771622829.png (300 KB, 469x540) Image search: [Google]
1450771622829.png
300 KB, 469x540
>>8010514
Well, n-now it is:
[eqn]f(x) = f(a) + (x-a) \frac{(x + a - 2b) f'(a) - (x-a) f'(b)}{2(a - b)}[/eqn]
>>
>>8010463
I'm pretty sure there are at least continuum many functions that go through points A and B and have the specified derivatives at those points.
>>
>>8010685
You're looking at the inverse image of a point under a linear transformation from an infinite dimensional space to a four dimensional one. Why are you only pretty sure?
>>
>>8010692
Because there are definitely people who know more about functions than me on this board, so I may be proven wrong.
>>
All functions f(x) that

f(a)=A
f(b)=B
f'(a)=C
f'(b)=D
>>
>>8010472
>>8010497
>>8010510
>>8010514
>>8010522
So I just tried this and it's wrong.
>>
>>8010463
Catmull-Rom interpolation would work wouldn't it?
Bezier would work too I guess.
Either way you'd just need to generate points along the slope of each
>>
>>8012023
Yeah, I'm going with numerically approximated Bezier curves. Thanks, though,
>>
>>8010463
People are really overthinking this. Given the following data points:

Point 1: (x0, y0) with slope m0
Point 2: (x1, y1) with slope m1

You need a function like:

f'(x)= m0*g0(x) + m1*g1(x) with g0 = 1 at x0 and 0 at x1. Similarly g1 = 1 at x1 and 0 at x0.

g0(x) = (x-x1)/(x0-x1) works for the first part.
g1(x) = (x-x0)/(x1-x0)works fro the second part.

Putting this together:

f'(x) = m0*(x-x1)/(x0-x1) + m1*(x-x0)/(x1-x0)

Integrate this and you get a nice polynomial of degree 2.You can extrapolate this to any number of points and slopes.

Note this is not a unique solution, just a polynomial solution that works. There are an infinite number of solution many of which may not be explicitly expressible in a closed form
>>
>>8010463
Use Newton's Interpolating Polynomial and a difference table
Thread replies: 21
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.