In [11]:
import numpy
import matplotlib.pyplot as plt
%matplotlib inline
import math
In [37]:
# want
t1 = numpy.linspace(start=-1.0, stop=1.0, num=201)
wave1 = numpy.power(2.0,t1)
# approx:
# have
# 0.0 -> 0.0
# 0.5 -> 0.25
# 0.707 -> 0.5
# 1.0 -> 1.0
# 1.41 -> 2.0
# 2.0 -> 4.0
#t1 = numpy.linspace(start=0, stop=2.0, num=201)
# wave1 = numpy.multiply(t1,t1)
# want range.x = 2 -> range.y = 1.5
# -1.0 -> 0.5
# 0.0 -> 1.0
# 1.0 -> 2.0
t2 = numpy.linspace(start=math.sqrt(.5), stop=math.sqrt(2.0), num=201)
# meh: math.srqt(.5) + (math.sqrt(.5) / 2.0) != 1.0
wave2 = numpy.multiply(t2,t2)
In [38]:
plt.figure(figsize=(100, 40))
plt.plot(wave1)
plt.plot(wave2)
plt.show()
In [31]:
print(t2[0], '=', wave2[0])
print(t2[100], '=', wave2[100])
print(t2[200], '=', wave2[200])
In [20]:
print(len(wave2))
In [ ]: