0
$\begingroup$

How to scale the sinusoid on the range $[0, 4pi]$ to the sinusoid on the range $[\frac{1}{10}, \frac{2}{10}]$?

I've had a couple of approaches, but I don't know how to do it. I tried use translation and it's simple, but difficult to me is linear scale

I'd like to use a python to plot:

enter image description here

import numpy as np
x = np.linspace(0,4*np.pi)

y = np.sin(x)

import matplotlib.pyplot as plt
plt.plot(x, y)

Edit: My bug:

import numpy as np
x = (np.linspace(0,4*np.pi))

y = np.sin(x)* (1/(40*np.pi)) + 1/10
print(y)
import matplotlib.pyplot as plt
plt.plot(x, np.sin(x))
$\endgroup$

1 Answer 1

1
$\begingroup$

Notice that you're trying to squeeze two wave forms into a length of $\frac{1}{10}$ which means that the period of your function should be $T = \frac{1}{20}$. Given the formula

$$ \omega \;\; =\;\; \frac{2\pi}{T} \;\; =\;\; 40\pi $$

and the fact that you want to shift it to the right $\frac{1}{10}$ then your function is

$$ f(x) \;\; =\;\; \sin\left [40\pi \left ( x - \frac{1}{10} \right )\right ]. $$

$\endgroup$
3
  • $\begingroup$ Where x belongs to? $x \in [0,4pi]$? $\endgroup$
    – Blabla
    Apr 29, 2020 at 21:47
  • $\begingroup$ It's wrong, for example if $x=1/10$ then $f(x) \neq 0$ $\endgroup$
    – Blabla
    Apr 29, 2020 at 21:48
  • 1
    $\begingroup$ @Blabla Edited. I needed a pair of parentheses. $\endgroup$
    – Mnifldz
    Apr 29, 2020 at 22:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .