I'm drawing a curve with equation like y=x^2.
How can i plot this curve in pixi.js or H5 canvas?
Now I can simply draw this curve in python.
# Import libraries
import matplotlib.pyplot as plt
import numpy as np
# Creating vectors X and Y
x = np.linspace(-2, 2, 100)
y = x ** 2
fig = plt.figure(figsize = (10, 5))
# Create the plot
plt.plot(x, y)
# Show the plot
plt.show()
I got some clues from following link.
how to draw smooth curve through N points using javascript HTML5 canvas?
do i have more simple solution, or some popular 3rd party js modules help me do this?