andero Posted June 5, 2018 Posted June 5, 2018 Hello! I am stuck with a relatively simple task. I am doing some coding and need a certain kind of motion to apply to an object. The motion graph should look something like in the picture. It may look like sqrt(x) at first but this isn't the case, I am wondering if there is some function that actually reaches a slope of 0 relatively quickly (or a VERY tiny slope) ? Thanks!
YaDinghus Posted June 5, 2018 Posted June 5, 2018 (edited) 13 minutes ago, andero said: Hello! I am stuck with a relatively simple task. I am doing some coding and need a certain kind of motion to apply to an object. The motion graph should look something like in the picture. It may look like sqrt(x) at first but this isn't the case, I am wondering if there is some function that actually reaches a slope of 0 relatively quickly (or a VERY tiny slope) ? Thanks! The ln function gets very close to a 0 slope rather quickly. What exactly are you trying to program? You could try and analytically continue a function with another one, and when its slope reaches 0 just replace it with a fixed value -k(x-t)^2+c for instance would give you a function that reaches a slope of 0 at it's summit, and you could then replace it by c when f'(x)==0 Edited June 5, 2018 by YaDinghus Example
andero Posted June 5, 2018 Author Posted June 5, 2018 6 minutes ago, YaDinghus said: The ln function gets very close to a 0 slope rather quickly. What exactly are you trying to program? You could try and analytically continue a function with another one, and when its slope reaches 0 just replace it with a fixed value I tried modifiying the ln(x) a bit and it's close enough to what I'd like. Thank you very much!
Strange Posted June 5, 2018 Posted June 5, 2018 You could try the tan function (or tan^2 to get an even faster change).
YaDinghus Posted June 5, 2018 Posted June 5, 2018 (edited) 5 minutes ago, andero said: I tried modifiying the ln(x) a bit and it's close enough to what I'd like. Thank you very much! Anytime 2 minutes ago, Strange said: You could try the tan function (or tan^2 to get an even faster change). Doesn't tan go 'straight' up once it passes x = pi/4? After all it has definition gaps every pi/2... Edited June 5, 2018 by YaDinghus
Sensei Posted June 5, 2018 Posted June 5, 2018 I get this graph in OpenOffice Calc using code "=IF(A1<1.5;SIN(A1)^0.5;1)" for cell B1. Fill it down to entire column. Check also 0.333 instead of 0.5.. Example result for "=IF(A1<1.75;SIN(A1^0.8333)^0.33;1)"
taeto Posted June 20, 2018 Posted June 20, 2018 (edited) On 6/5/2018 at 1:32 PM, YaDinghus said: Doesn't tan go 'straight' up once it passes x = pi/4? After all it has definition gaps every pi/2... He means arctan (times a suitable constant). It is different from a logarithm in an important respect. Although both functions will keep increasing, the log is unbounded, whereas arctan will approach an upper limit. So it depends on which of those properties you are aiming for. Edited June 20, 2018 by taeto
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now