0
$\begingroup$

Please provide any formula or step by step guide how to generate function for the following graph. Graph logic:

part 1 -> where x <= 3 -> linear relation

part 2 -> when x from 3 to 6 -> y remains unchanged

then again part 1 with 3 < x < 9 - > linear relation

then part 2 when y remains unchanged

enter image description here

Thanks!

EDIT: Values for x,y

x=0 y=0

x=1 y=1

x=2 y=2

x=3 y=3

x=4 y=3

x=5 y=3

x=6 y=3

x=7 y=3

x=8 y=3

x=9 y=3

x=10 y=4

x=11 y=5

x=12 y=6

x=13 y=6

x=14 y=6

and so on..

I am trying to create an interpolator for the following case:

Interpolation time 3500 ms

Value start = 0, end= 1

first 500 ms value increases by the formula (end/3500)*interpolated time

then 1000 ms value remains unchanged

then 500 ms again value increases

then 1000 ms value remains unchanged

then 500 ms again value increases

$\endgroup$
6
  • $\begingroup$ What is the value of $f(x) = y$ in the interval $[3, 9]$? You have to construct a piecewise function. Define $f(x)$ on separate intervals of $x$, just like you have verbally done in your question. $\endgroup$ – JacobCheverie Apr 23 '19 at 15:47
  • $\begingroup$ Do you know how to get the equation of of line if you are given two points on the line? When you ask a question here it helps a lot if you tell us what you have tried and what you know about the question. Otherwise, we don't know where to start with an answer. $\endgroup$ – saulspatz Apr 23 '19 at 15:48
  • $\begingroup$ @Joshiepillow Thanks, thats was my mistake $\endgroup$ – Ololoking Apr 23 '19 at 16:01
  • $\begingroup$ @saulspatz I've updated my question with a bit more explanations. Please check it $\endgroup$ – Ololoking Apr 23 '19 at 16:02
  • $\begingroup$ @JacobCheverie I've updated my question with a bit more explanations. Please check it $\endgroup$ – Ololoking Apr 23 '19 at 16:03
0
$\begingroup$

y = x - 2a/3 {a <= x < a + 3}

y = a/3 +3 {a+3 <= x < a + 9}

Where a is defined as all numbers which mod(9, a) = 0.

Basically a is divisible by 9.

Tried this on Desmos. It works but you’ll have to manually type in every value of a. enter image description hereenter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.