Looking for a sine curve with custom midpoint
$begingroup$
For a signal generating software, I'm looking for a function that generates a sine-based curve but with a shifted midpoint. Usually, a sine curve looks like this:
in out slope
-------------------
0.0 pi 0 1
0.5 pi 1 0
1.0 pi 0 -1
1.5 pi -1 0
2.0 pi 0 1
I need to move the midpoint from pi to an arbitrary other value, like 0.7 pi or 1.4 pi. The quarter points should still be in the middle of their side, but if they're slightly off to make the curve "look better", that's fine, too. Example:
in out slope
-------------------
0.0 pi 0 1
0.7 pi 1 0
1.4 pi 0 -1
1.7 pi -1 0
2.0 pi 0 1
What function gives me these values?
curves
$endgroup$
add a comment |
$begingroup$
For a signal generating software, I'm looking for a function that generates a sine-based curve but with a shifted midpoint. Usually, a sine curve looks like this:
in out slope
-------------------
0.0 pi 0 1
0.5 pi 1 0
1.0 pi 0 -1
1.5 pi -1 0
2.0 pi 0 1
I need to move the midpoint from pi to an arbitrary other value, like 0.7 pi or 1.4 pi. The quarter points should still be in the middle of their side, but if they're slightly off to make the curve "look better", that's fine, too. Example:
in out slope
-------------------
0.0 pi 0 1
0.7 pi 1 0
1.4 pi 0 -1
1.7 pi -1 0
2.0 pi 0 1
What function gives me these values?
curves
$endgroup$
add a comment |
$begingroup$
For a signal generating software, I'm looking for a function that generates a sine-based curve but with a shifted midpoint. Usually, a sine curve looks like this:
in out slope
-------------------
0.0 pi 0 1
0.5 pi 1 0
1.0 pi 0 -1
1.5 pi -1 0
2.0 pi 0 1
I need to move the midpoint from pi to an arbitrary other value, like 0.7 pi or 1.4 pi. The quarter points should still be in the middle of their side, but if they're slightly off to make the curve "look better", that's fine, too. Example:
in out slope
-------------------
0.0 pi 0 1
0.7 pi 1 0
1.4 pi 0 -1
1.7 pi -1 0
2.0 pi 0 1
What function gives me these values?
curves
$endgroup$
For a signal generating software, I'm looking for a function that generates a sine-based curve but with a shifted midpoint. Usually, a sine curve looks like this:
in out slope
-------------------
0.0 pi 0 1
0.5 pi 1 0
1.0 pi 0 -1
1.5 pi -1 0
2.0 pi 0 1
I need to move the midpoint from pi to an arbitrary other value, like 0.7 pi or 1.4 pi. The quarter points should still be in the middle of their side, but if they're slightly off to make the curve "look better", that's fine, too. Example:
in out slope
-------------------
0.0 pi 0 1
0.7 pi 1 0
1.4 pi 0 -1
1.7 pi -1 0
2.0 pi 0 1
What function gives me these values?
curves
curves
asked Dec 9 '18 at 20:33
ygoeygoe
1062
1062
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
The simplest is to define a piecewise linear function that takes the new $x$ values to the old ones. So let $$y=begin {cases} frac x{1.4} & x le 1.4pi\pi+frac {x-1.4 pi}{0.6}&1.4pi lt x le 2pi end {cases}$$ and use $sin (y)$
$endgroup$
$begingroup$
While that's simple and comprehensible, there's a break at the midpoint where the curve suddenly changes direction. It's not smooth. (Forgive me my simple math words, I've learnt them in German only at school, long ago.)
$endgroup$
– ygoe
Dec 9 '18 at 22:23
$begingroup$
True, there is a break in the derivative. You have five points based on what you specified. You can put any curve you want through them. You could use a Bezier curve, which is continuous through the second derivative, but is harder to derive.
$endgroup$
– Ross Millikan
Dec 9 '18 at 22:47
add a comment |
$begingroup$
Not exactly what you asked for but a derivable periodic function ($a$ is the "control parameter") :
$$f_a(x):=sinleft(x-a,sin(x/2)^2right)$$
$f_1(x);$ would produce the smooth :
The idea is to replace the 'input' identity function $;xmapsto x;$ with something growing more slowly in $(0,2pi)$ and with derivative $1$ at $2kpi$ as illustrated here ( $xmapsto x-a,sin(x/2)^2$ ):
If you want the input function to be linear at the left you may indeed use a cubic curve to come back to the next linear part. I preferred the $sin$ function in the map :
$$xmapsto begin{cases} x-a,x & x < pi\ x-a,xdfrac{1-sin(x-3pi/2)}2&x ge pi end{cases}$$
If the first part of the $sin$ function has to be preserved (stretched only) you'll have to replace the $,x < pi,$ by $,x < frac{pi}{1-a},$ with a somewhat more complicated function :
$$xmapsto begin{cases} x-a,x & x < frac{pi}{1-a}\ x-dfrac{a,x}2left(1-sinleft(dfrac {x-pi-frac{pi}{2(1-a)}}{2-frac 1{1-a}}right)right)&x ge frac{pi}{1-a} end{cases}$$
In this case we need $;0le ale dfrac 12;$ and the second part of the $sin$ function will collapse entirely for $a=dfrac 12$.
Final result for $a=0.3$ :
$endgroup$
$begingroup$
($xmapsto x-a,sin(x/2)$ appears nicer in $(0,2pi)$ but is reverted in the following interval)
$endgroup$
– Raymond Manzoni
Dec 9 '18 at 21:34
$begingroup$
Hm, I've tried it but the result's didn't look too good. Especially the selection of the midpoint is very limited. But the idea of putting another function before the sin(x) is interesting. I'll have to play with that for a bit.
$endgroup$
– ygoe
Dec 9 '18 at 22:22
$begingroup$
I've found something interesting. A Bézier curve might be helpful to build a smooth connection from the first to the second section. Then apply sin on that. I'll look into that tomorrow.
$endgroup$
– ygoe
Dec 9 '18 at 22:47
$begingroup$
The Bézier function indeed did lead to a curve similar to what I had in mind. There's a JavaScript implementation of it which I ported to C# for my case. github.com/gre/bezier-easing I use control points that are symmetric so that there's no break when repeating the pattern. The resulting "easing" value is then put into sin().
$endgroup$
– ygoe
Dec 12 '18 at 20:41
$begingroup$
Thanks for the follow up @ygoe! You may propose your solution as an answer here, excellent continuation,
$endgroup$
– Raymond Manzoni
Dec 12 '18 at 22:50
add a comment |
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%2f3032957%2flooking-for-a-sine-curve-with-custom-midpoint%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
The simplest is to define a piecewise linear function that takes the new $x$ values to the old ones. So let $$y=begin {cases} frac x{1.4} & x le 1.4pi\pi+frac {x-1.4 pi}{0.6}&1.4pi lt x le 2pi end {cases}$$ and use $sin (y)$
$endgroup$
$begingroup$
While that's simple and comprehensible, there's a break at the midpoint where the curve suddenly changes direction. It's not smooth. (Forgive me my simple math words, I've learnt them in German only at school, long ago.)
$endgroup$
– ygoe
Dec 9 '18 at 22:23
$begingroup$
True, there is a break in the derivative. You have five points based on what you specified. You can put any curve you want through them. You could use a Bezier curve, which is continuous through the second derivative, but is harder to derive.
$endgroup$
– Ross Millikan
Dec 9 '18 at 22:47
add a comment |
$begingroup$
The simplest is to define a piecewise linear function that takes the new $x$ values to the old ones. So let $$y=begin {cases} frac x{1.4} & x le 1.4pi\pi+frac {x-1.4 pi}{0.6}&1.4pi lt x le 2pi end {cases}$$ and use $sin (y)$
$endgroup$
$begingroup$
While that's simple and comprehensible, there's a break at the midpoint where the curve suddenly changes direction. It's not smooth. (Forgive me my simple math words, I've learnt them in German only at school, long ago.)
$endgroup$
– ygoe
Dec 9 '18 at 22:23
$begingroup$
True, there is a break in the derivative. You have five points based on what you specified. You can put any curve you want through them. You could use a Bezier curve, which is continuous through the second derivative, but is harder to derive.
$endgroup$
– Ross Millikan
Dec 9 '18 at 22:47
add a comment |
$begingroup$
The simplest is to define a piecewise linear function that takes the new $x$ values to the old ones. So let $$y=begin {cases} frac x{1.4} & x le 1.4pi\pi+frac {x-1.4 pi}{0.6}&1.4pi lt x le 2pi end {cases}$$ and use $sin (y)$
$endgroup$
The simplest is to define a piecewise linear function that takes the new $x$ values to the old ones. So let $$y=begin {cases} frac x{1.4} & x le 1.4pi\pi+frac {x-1.4 pi}{0.6}&1.4pi lt x le 2pi end {cases}$$ and use $sin (y)$
answered Dec 9 '18 at 21:23
Ross MillikanRoss Millikan
295k23198371
295k23198371
$begingroup$
While that's simple and comprehensible, there's a break at the midpoint where the curve suddenly changes direction. It's not smooth. (Forgive me my simple math words, I've learnt them in German only at school, long ago.)
$endgroup$
– ygoe
Dec 9 '18 at 22:23
$begingroup$
True, there is a break in the derivative. You have five points based on what you specified. You can put any curve you want through them. You could use a Bezier curve, which is continuous through the second derivative, but is harder to derive.
$endgroup$
– Ross Millikan
Dec 9 '18 at 22:47
add a comment |
$begingroup$
While that's simple and comprehensible, there's a break at the midpoint where the curve suddenly changes direction. It's not smooth. (Forgive me my simple math words, I've learnt them in German only at school, long ago.)
$endgroup$
– ygoe
Dec 9 '18 at 22:23
$begingroup$
True, there is a break in the derivative. You have five points based on what you specified. You can put any curve you want through them. You could use a Bezier curve, which is continuous through the second derivative, but is harder to derive.
$endgroup$
– Ross Millikan
Dec 9 '18 at 22:47
$begingroup$
While that's simple and comprehensible, there's a break at the midpoint where the curve suddenly changes direction. It's not smooth. (Forgive me my simple math words, I've learnt them in German only at school, long ago.)
$endgroup$
– ygoe
Dec 9 '18 at 22:23
$begingroup$
While that's simple and comprehensible, there's a break at the midpoint where the curve suddenly changes direction. It's not smooth. (Forgive me my simple math words, I've learnt them in German only at school, long ago.)
$endgroup$
– ygoe
Dec 9 '18 at 22:23
$begingroup$
True, there is a break in the derivative. You have five points based on what you specified. You can put any curve you want through them. You could use a Bezier curve, which is continuous through the second derivative, but is harder to derive.
$endgroup$
– Ross Millikan
Dec 9 '18 at 22:47
$begingroup$
True, there is a break in the derivative. You have five points based on what you specified. You can put any curve you want through them. You could use a Bezier curve, which is continuous through the second derivative, but is harder to derive.
$endgroup$
– Ross Millikan
Dec 9 '18 at 22:47
add a comment |
$begingroup$
Not exactly what you asked for but a derivable periodic function ($a$ is the "control parameter") :
$$f_a(x):=sinleft(x-a,sin(x/2)^2right)$$
$f_1(x);$ would produce the smooth :
The idea is to replace the 'input' identity function $;xmapsto x;$ with something growing more slowly in $(0,2pi)$ and with derivative $1$ at $2kpi$ as illustrated here ( $xmapsto x-a,sin(x/2)^2$ ):
If you want the input function to be linear at the left you may indeed use a cubic curve to come back to the next linear part. I preferred the $sin$ function in the map :
$$xmapsto begin{cases} x-a,x & x < pi\ x-a,xdfrac{1-sin(x-3pi/2)}2&x ge pi end{cases}$$
If the first part of the $sin$ function has to be preserved (stretched only) you'll have to replace the $,x < pi,$ by $,x < frac{pi}{1-a},$ with a somewhat more complicated function :
$$xmapsto begin{cases} x-a,x & x < frac{pi}{1-a}\ x-dfrac{a,x}2left(1-sinleft(dfrac {x-pi-frac{pi}{2(1-a)}}{2-frac 1{1-a}}right)right)&x ge frac{pi}{1-a} end{cases}$$
In this case we need $;0le ale dfrac 12;$ and the second part of the $sin$ function will collapse entirely for $a=dfrac 12$.
Final result for $a=0.3$ :
$endgroup$
$begingroup$
($xmapsto x-a,sin(x/2)$ appears nicer in $(0,2pi)$ but is reverted in the following interval)
$endgroup$
– Raymond Manzoni
Dec 9 '18 at 21:34
$begingroup$
Hm, I've tried it but the result's didn't look too good. Especially the selection of the midpoint is very limited. But the idea of putting another function before the sin(x) is interesting. I'll have to play with that for a bit.
$endgroup$
– ygoe
Dec 9 '18 at 22:22
$begingroup$
I've found something interesting. A Bézier curve might be helpful to build a smooth connection from the first to the second section. Then apply sin on that. I'll look into that tomorrow.
$endgroup$
– ygoe
Dec 9 '18 at 22:47
$begingroup$
The Bézier function indeed did lead to a curve similar to what I had in mind. There's a JavaScript implementation of it which I ported to C# for my case. github.com/gre/bezier-easing I use control points that are symmetric so that there's no break when repeating the pattern. The resulting "easing" value is then put into sin().
$endgroup$
– ygoe
Dec 12 '18 at 20:41
$begingroup$
Thanks for the follow up @ygoe! You may propose your solution as an answer here, excellent continuation,
$endgroup$
– Raymond Manzoni
Dec 12 '18 at 22:50
add a comment |
$begingroup$
Not exactly what you asked for but a derivable periodic function ($a$ is the "control parameter") :
$$f_a(x):=sinleft(x-a,sin(x/2)^2right)$$
$f_1(x);$ would produce the smooth :
The idea is to replace the 'input' identity function $;xmapsto x;$ with something growing more slowly in $(0,2pi)$ and with derivative $1$ at $2kpi$ as illustrated here ( $xmapsto x-a,sin(x/2)^2$ ):
If you want the input function to be linear at the left you may indeed use a cubic curve to come back to the next linear part. I preferred the $sin$ function in the map :
$$xmapsto begin{cases} x-a,x & x < pi\ x-a,xdfrac{1-sin(x-3pi/2)}2&x ge pi end{cases}$$
If the first part of the $sin$ function has to be preserved (stretched only) you'll have to replace the $,x < pi,$ by $,x < frac{pi}{1-a},$ with a somewhat more complicated function :
$$xmapsto begin{cases} x-a,x & x < frac{pi}{1-a}\ x-dfrac{a,x}2left(1-sinleft(dfrac {x-pi-frac{pi}{2(1-a)}}{2-frac 1{1-a}}right)right)&x ge frac{pi}{1-a} end{cases}$$
In this case we need $;0le ale dfrac 12;$ and the second part of the $sin$ function will collapse entirely for $a=dfrac 12$.
Final result for $a=0.3$ :
$endgroup$
$begingroup$
($xmapsto x-a,sin(x/2)$ appears nicer in $(0,2pi)$ but is reverted in the following interval)
$endgroup$
– Raymond Manzoni
Dec 9 '18 at 21:34
$begingroup$
Hm, I've tried it but the result's didn't look too good. Especially the selection of the midpoint is very limited. But the idea of putting another function before the sin(x) is interesting. I'll have to play with that for a bit.
$endgroup$
– ygoe
Dec 9 '18 at 22:22
$begingroup$
I've found something interesting. A Bézier curve might be helpful to build a smooth connection from the first to the second section. Then apply sin on that. I'll look into that tomorrow.
$endgroup$
– ygoe
Dec 9 '18 at 22:47
$begingroup$
The Bézier function indeed did lead to a curve similar to what I had in mind. There's a JavaScript implementation of it which I ported to C# for my case. github.com/gre/bezier-easing I use control points that are symmetric so that there's no break when repeating the pattern. The resulting "easing" value is then put into sin().
$endgroup$
– ygoe
Dec 12 '18 at 20:41
$begingroup$
Thanks for the follow up @ygoe! You may propose your solution as an answer here, excellent continuation,
$endgroup$
– Raymond Manzoni
Dec 12 '18 at 22:50
add a comment |
$begingroup$
Not exactly what you asked for but a derivable periodic function ($a$ is the "control parameter") :
$$f_a(x):=sinleft(x-a,sin(x/2)^2right)$$
$f_1(x);$ would produce the smooth :
The idea is to replace the 'input' identity function $;xmapsto x;$ with something growing more slowly in $(0,2pi)$ and with derivative $1$ at $2kpi$ as illustrated here ( $xmapsto x-a,sin(x/2)^2$ ):
If you want the input function to be linear at the left you may indeed use a cubic curve to come back to the next linear part. I preferred the $sin$ function in the map :
$$xmapsto begin{cases} x-a,x & x < pi\ x-a,xdfrac{1-sin(x-3pi/2)}2&x ge pi end{cases}$$
If the first part of the $sin$ function has to be preserved (stretched only) you'll have to replace the $,x < pi,$ by $,x < frac{pi}{1-a},$ with a somewhat more complicated function :
$$xmapsto begin{cases} x-a,x & x < frac{pi}{1-a}\ x-dfrac{a,x}2left(1-sinleft(dfrac {x-pi-frac{pi}{2(1-a)}}{2-frac 1{1-a}}right)right)&x ge frac{pi}{1-a} end{cases}$$
In this case we need $;0le ale dfrac 12;$ and the second part of the $sin$ function will collapse entirely for $a=dfrac 12$.
Final result for $a=0.3$ :
$endgroup$
Not exactly what you asked for but a derivable periodic function ($a$ is the "control parameter") :
$$f_a(x):=sinleft(x-a,sin(x/2)^2right)$$
$f_1(x);$ would produce the smooth :
The idea is to replace the 'input' identity function $;xmapsto x;$ with something growing more slowly in $(0,2pi)$ and with derivative $1$ at $2kpi$ as illustrated here ( $xmapsto x-a,sin(x/2)^2$ ):
If you want the input function to be linear at the left you may indeed use a cubic curve to come back to the next linear part. I preferred the $sin$ function in the map :
$$xmapsto begin{cases} x-a,x & x < pi\ x-a,xdfrac{1-sin(x-3pi/2)}2&x ge pi end{cases}$$
If the first part of the $sin$ function has to be preserved (stretched only) you'll have to replace the $,x < pi,$ by $,x < frac{pi}{1-a},$ with a somewhat more complicated function :
$$xmapsto begin{cases} x-a,x & x < frac{pi}{1-a}\ x-dfrac{a,x}2left(1-sinleft(dfrac {x-pi-frac{pi}{2(1-a)}}{2-frac 1{1-a}}right)right)&x ge frac{pi}{1-a} end{cases}$$
In this case we need $;0le ale dfrac 12;$ and the second part of the $sin$ function will collapse entirely for $a=dfrac 12$.
Final result for $a=0.3$ :
edited Dec 10 '18 at 10:30
answered Dec 9 '18 at 21:24
Raymond ManzoniRaymond Manzoni
37.1k563117
37.1k563117
$begingroup$
($xmapsto x-a,sin(x/2)$ appears nicer in $(0,2pi)$ but is reverted in the following interval)
$endgroup$
– Raymond Manzoni
Dec 9 '18 at 21:34
$begingroup$
Hm, I've tried it but the result's didn't look too good. Especially the selection of the midpoint is very limited. But the idea of putting another function before the sin(x) is interesting. I'll have to play with that for a bit.
$endgroup$
– ygoe
Dec 9 '18 at 22:22
$begingroup$
I've found something interesting. A Bézier curve might be helpful to build a smooth connection from the first to the second section. Then apply sin on that. I'll look into that tomorrow.
$endgroup$
– ygoe
Dec 9 '18 at 22:47
$begingroup$
The Bézier function indeed did lead to a curve similar to what I had in mind. There's a JavaScript implementation of it which I ported to C# for my case. github.com/gre/bezier-easing I use control points that are symmetric so that there's no break when repeating the pattern. The resulting "easing" value is then put into sin().
$endgroup$
– ygoe
Dec 12 '18 at 20:41
$begingroup$
Thanks for the follow up @ygoe! You may propose your solution as an answer here, excellent continuation,
$endgroup$
– Raymond Manzoni
Dec 12 '18 at 22:50
add a comment |
$begingroup$
($xmapsto x-a,sin(x/2)$ appears nicer in $(0,2pi)$ but is reverted in the following interval)
$endgroup$
– Raymond Manzoni
Dec 9 '18 at 21:34
$begingroup$
Hm, I've tried it but the result's didn't look too good. Especially the selection of the midpoint is very limited. But the idea of putting another function before the sin(x) is interesting. I'll have to play with that for a bit.
$endgroup$
– ygoe
Dec 9 '18 at 22:22
$begingroup$
I've found something interesting. A Bézier curve might be helpful to build a smooth connection from the first to the second section. Then apply sin on that. I'll look into that tomorrow.
$endgroup$
– ygoe
Dec 9 '18 at 22:47
$begingroup$
The Bézier function indeed did lead to a curve similar to what I had in mind. There's a JavaScript implementation of it which I ported to C# for my case. github.com/gre/bezier-easing I use control points that are symmetric so that there's no break when repeating the pattern. The resulting "easing" value is then put into sin().
$endgroup$
– ygoe
Dec 12 '18 at 20:41
$begingroup$
Thanks for the follow up @ygoe! You may propose your solution as an answer here, excellent continuation,
$endgroup$
– Raymond Manzoni
Dec 12 '18 at 22:50
$begingroup$
($xmapsto x-a,sin(x/2)$ appears nicer in $(0,2pi)$ but is reverted in the following interval)
$endgroup$
– Raymond Manzoni
Dec 9 '18 at 21:34
$begingroup$
($xmapsto x-a,sin(x/2)$ appears nicer in $(0,2pi)$ but is reverted in the following interval)
$endgroup$
– Raymond Manzoni
Dec 9 '18 at 21:34
$begingroup$
Hm, I've tried it but the result's didn't look too good. Especially the selection of the midpoint is very limited. But the idea of putting another function before the sin(x) is interesting. I'll have to play with that for a bit.
$endgroup$
– ygoe
Dec 9 '18 at 22:22
$begingroup$
Hm, I've tried it but the result's didn't look too good. Especially the selection of the midpoint is very limited. But the idea of putting another function before the sin(x) is interesting. I'll have to play with that for a bit.
$endgroup$
– ygoe
Dec 9 '18 at 22:22
$begingroup$
I've found something interesting. A Bézier curve might be helpful to build a smooth connection from the first to the second section. Then apply sin on that. I'll look into that tomorrow.
$endgroup$
– ygoe
Dec 9 '18 at 22:47
$begingroup$
I've found something interesting. A Bézier curve might be helpful to build a smooth connection from the first to the second section. Then apply sin on that. I'll look into that tomorrow.
$endgroup$
– ygoe
Dec 9 '18 at 22:47
$begingroup$
The Bézier function indeed did lead to a curve similar to what I had in mind. There's a JavaScript implementation of it which I ported to C# for my case. github.com/gre/bezier-easing I use control points that are symmetric so that there's no break when repeating the pattern. The resulting "easing" value is then put into sin().
$endgroup$
– ygoe
Dec 12 '18 at 20:41
$begingroup$
The Bézier function indeed did lead to a curve similar to what I had in mind. There's a JavaScript implementation of it which I ported to C# for my case. github.com/gre/bezier-easing I use control points that are symmetric so that there's no break when repeating the pattern. The resulting "easing" value is then put into sin().
$endgroup$
– ygoe
Dec 12 '18 at 20:41
$begingroup$
Thanks for the follow up @ygoe! You may propose your solution as an answer here, excellent continuation,
$endgroup$
– Raymond Manzoni
Dec 12 '18 at 22:50
$begingroup$
Thanks for the follow up @ygoe! You may propose your solution as an answer here, excellent continuation,
$endgroup$
– Raymond Manzoni
Dec 12 '18 at 22:50
add a comment |
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%2f3032957%2flooking-for-a-sine-curve-with-custom-midpoint%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