Looking for an algorithm to create an interpolated curve function with specific requirements
$begingroup$
I need this algorithm for an editing program to allow users to adjust curves, and I want those curves to conform to some particular requirements. For simplicity of use I would like to be able to define the curve entirely by control points that lie on the curve, which means no additional variables can be used to define tangents.
I want the curve to be smooth everywhere and monotonic between control points, and I also want it to be a function so that every X value maps to a single Y value.
The really tricky part is that the addition of a new control point that lies on the curve should not alter the curve. The curve should only change in shape if the new control point is moved.
Is there any existing algorithm that satisfies these requirements? I imagine I will need to split the curve up into segments to achieve this.
algorithms graphing-functions curves interpolation
$endgroup$
|
show 2 more comments
$begingroup$
I need this algorithm for an editing program to allow users to adjust curves, and I want those curves to conform to some particular requirements. For simplicity of use I would like to be able to define the curve entirely by control points that lie on the curve, which means no additional variables can be used to define tangents.
I want the curve to be smooth everywhere and monotonic between control points, and I also want it to be a function so that every X value maps to a single Y value.
The really tricky part is that the addition of a new control point that lies on the curve should not alter the curve. The curve should only change in shape if the new control point is moved.
Is there any existing algorithm that satisfies these requirements? I imagine I will need to split the curve up into segments to achieve this.
algorithms graphing-functions curves interpolation
$endgroup$
$begingroup$
Just wanted to add, although this looks like a very simple issue where the user could easily just define their own tangents to build whatever curve they want, this curve actually represents the profile of a 3-dimensional shape that will already be quite complex, which is why I want to eliminate as much complexity from the user's end as possible.
$endgroup$
– Excrubulent
Dec 31 '18 at 1:46
$begingroup$
Splines aren't $C^infty$ but they can be made $C^3$ or more.
$endgroup$
– steven gregory
Dec 31 '18 at 2:57
$begingroup$
@stevengregory I'm afraid I don't understand what that means.
$endgroup$
– Excrubulent
Dec 31 '18 at 5:29
$begingroup$
Since writing this I have discovered "monotonic cubic spline interpolation", where tangents are set to ensure monotonicity. I imagine I could use this method and just ensure that wherever there is a local maximum or minimum in the control points, the tangent is set to zero at that point. I'm not certain how to ensure that this also satisfies my requirement that new points do not modify the curve, but I may have to simply relax that requirement.
$endgroup$
– Excrubulent
Dec 31 '18 at 6:21
1
$begingroup$
As far as I know, no algorithm is able to satisfy the requirement of "adding a new point that lies on the curve should not alter the curve". If you are willing to relax this requirement, then "monotonic cubic spline interpolation" will be your solution.
$endgroup$
– fang
Dec 31 '18 at 20:50
|
show 2 more comments
$begingroup$
I need this algorithm for an editing program to allow users to adjust curves, and I want those curves to conform to some particular requirements. For simplicity of use I would like to be able to define the curve entirely by control points that lie on the curve, which means no additional variables can be used to define tangents.
I want the curve to be smooth everywhere and monotonic between control points, and I also want it to be a function so that every X value maps to a single Y value.
The really tricky part is that the addition of a new control point that lies on the curve should not alter the curve. The curve should only change in shape if the new control point is moved.
Is there any existing algorithm that satisfies these requirements? I imagine I will need to split the curve up into segments to achieve this.
algorithms graphing-functions curves interpolation
$endgroup$
I need this algorithm for an editing program to allow users to adjust curves, and I want those curves to conform to some particular requirements. For simplicity of use I would like to be able to define the curve entirely by control points that lie on the curve, which means no additional variables can be used to define tangents.
I want the curve to be smooth everywhere and monotonic between control points, and I also want it to be a function so that every X value maps to a single Y value.
The really tricky part is that the addition of a new control point that lies on the curve should not alter the curve. The curve should only change in shape if the new control point is moved.
Is there any existing algorithm that satisfies these requirements? I imagine I will need to split the curve up into segments to achieve this.
algorithms graphing-functions curves interpolation
algorithms graphing-functions curves interpolation
asked Dec 31 '18 at 1:42
ExcrubulentExcrubulent
1163
1163
$begingroup$
Just wanted to add, although this looks like a very simple issue where the user could easily just define their own tangents to build whatever curve they want, this curve actually represents the profile of a 3-dimensional shape that will already be quite complex, which is why I want to eliminate as much complexity from the user's end as possible.
$endgroup$
– Excrubulent
Dec 31 '18 at 1:46
$begingroup$
Splines aren't $C^infty$ but they can be made $C^3$ or more.
$endgroup$
– steven gregory
Dec 31 '18 at 2:57
$begingroup$
@stevengregory I'm afraid I don't understand what that means.
$endgroup$
– Excrubulent
Dec 31 '18 at 5:29
$begingroup$
Since writing this I have discovered "monotonic cubic spline interpolation", where tangents are set to ensure monotonicity. I imagine I could use this method and just ensure that wherever there is a local maximum or minimum in the control points, the tangent is set to zero at that point. I'm not certain how to ensure that this also satisfies my requirement that new points do not modify the curve, but I may have to simply relax that requirement.
$endgroup$
– Excrubulent
Dec 31 '18 at 6:21
1
$begingroup$
As far as I know, no algorithm is able to satisfy the requirement of "adding a new point that lies on the curve should not alter the curve". If you are willing to relax this requirement, then "monotonic cubic spline interpolation" will be your solution.
$endgroup$
– fang
Dec 31 '18 at 20:50
|
show 2 more comments
$begingroup$
Just wanted to add, although this looks like a very simple issue where the user could easily just define their own tangents to build whatever curve they want, this curve actually represents the profile of a 3-dimensional shape that will already be quite complex, which is why I want to eliminate as much complexity from the user's end as possible.
$endgroup$
– Excrubulent
Dec 31 '18 at 1:46
$begingroup$
Splines aren't $C^infty$ but they can be made $C^3$ or more.
$endgroup$
– steven gregory
Dec 31 '18 at 2:57
$begingroup$
@stevengregory I'm afraid I don't understand what that means.
$endgroup$
– Excrubulent
Dec 31 '18 at 5:29
$begingroup$
Since writing this I have discovered "monotonic cubic spline interpolation", where tangents are set to ensure monotonicity. I imagine I could use this method and just ensure that wherever there is a local maximum or minimum in the control points, the tangent is set to zero at that point. I'm not certain how to ensure that this also satisfies my requirement that new points do not modify the curve, but I may have to simply relax that requirement.
$endgroup$
– Excrubulent
Dec 31 '18 at 6:21
1
$begingroup$
As far as I know, no algorithm is able to satisfy the requirement of "adding a new point that lies on the curve should not alter the curve". If you are willing to relax this requirement, then "monotonic cubic spline interpolation" will be your solution.
$endgroup$
– fang
Dec 31 '18 at 20:50
$begingroup$
Just wanted to add, although this looks like a very simple issue where the user could easily just define their own tangents to build whatever curve they want, this curve actually represents the profile of a 3-dimensional shape that will already be quite complex, which is why I want to eliminate as much complexity from the user's end as possible.
$endgroup$
– Excrubulent
Dec 31 '18 at 1:46
$begingroup$
Just wanted to add, although this looks like a very simple issue where the user could easily just define their own tangents to build whatever curve they want, this curve actually represents the profile of a 3-dimensional shape that will already be quite complex, which is why I want to eliminate as much complexity from the user's end as possible.
$endgroup$
– Excrubulent
Dec 31 '18 at 1:46
$begingroup$
Splines aren't $C^infty$ but they can be made $C^3$ or more.
$endgroup$
– steven gregory
Dec 31 '18 at 2:57
$begingroup$
Splines aren't $C^infty$ but they can be made $C^3$ or more.
$endgroup$
– steven gregory
Dec 31 '18 at 2:57
$begingroup$
@stevengregory I'm afraid I don't understand what that means.
$endgroup$
– Excrubulent
Dec 31 '18 at 5:29
$begingroup$
@stevengregory I'm afraid I don't understand what that means.
$endgroup$
– Excrubulent
Dec 31 '18 at 5:29
$begingroup$
Since writing this I have discovered "monotonic cubic spline interpolation", where tangents are set to ensure monotonicity. I imagine I could use this method and just ensure that wherever there is a local maximum or minimum in the control points, the tangent is set to zero at that point. I'm not certain how to ensure that this also satisfies my requirement that new points do not modify the curve, but I may have to simply relax that requirement.
$endgroup$
– Excrubulent
Dec 31 '18 at 6:21
$begingroup$
Since writing this I have discovered "monotonic cubic spline interpolation", where tangents are set to ensure monotonicity. I imagine I could use this method and just ensure that wherever there is a local maximum or minimum in the control points, the tangent is set to zero at that point. I'm not certain how to ensure that this also satisfies my requirement that new points do not modify the curve, but I may have to simply relax that requirement.
$endgroup$
– Excrubulent
Dec 31 '18 at 6:21
1
1
$begingroup$
As far as I know, no algorithm is able to satisfy the requirement of "adding a new point that lies on the curve should not alter the curve". If you are willing to relax this requirement, then "monotonic cubic spline interpolation" will be your solution.
$endgroup$
– fang
Dec 31 '18 at 20:50
$begingroup$
As far as I know, no algorithm is able to satisfy the requirement of "adding a new point that lies on the curve should not alter the curve". If you are willing to relax this requirement, then "monotonic cubic spline interpolation" will be your solution.
$endgroup$
– fang
Dec 31 '18 at 20:50
|
show 2 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3057365%2flooking-for-an-algorithm-to-create-an-interpolated-curve-function-with-specific%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3057365%2flooking-for-an-algorithm-to-create-an-interpolated-curve-function-with-specific%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Just wanted to add, although this looks like a very simple issue where the user could easily just define their own tangents to build whatever curve they want, this curve actually represents the profile of a 3-dimensional shape that will already be quite complex, which is why I want to eliminate as much complexity from the user's end as possible.
$endgroup$
– Excrubulent
Dec 31 '18 at 1:46
$begingroup$
Splines aren't $C^infty$ but they can be made $C^3$ or more.
$endgroup$
– steven gregory
Dec 31 '18 at 2:57
$begingroup$
@stevengregory I'm afraid I don't understand what that means.
$endgroup$
– Excrubulent
Dec 31 '18 at 5:29
$begingroup$
Since writing this I have discovered "monotonic cubic spline interpolation", where tangents are set to ensure monotonicity. I imagine I could use this method and just ensure that wherever there is a local maximum or minimum in the control points, the tangent is set to zero at that point. I'm not certain how to ensure that this also satisfies my requirement that new points do not modify the curve, but I may have to simply relax that requirement.
$endgroup$
– Excrubulent
Dec 31 '18 at 6:21
1
$begingroup$
As far as I know, no algorithm is able to satisfy the requirement of "adding a new point that lies on the curve should not alter the curve". If you are willing to relax this requirement, then "monotonic cubic spline interpolation" will be your solution.
$endgroup$
– fang
Dec 31 '18 at 20:50