I have the following function to plot:
f(x) = 3 + (x - (2 6)T )T · (x - (2 6)T)
where (2 6) is a vector, T represents transpose and x is a vector of size 2. My question is how can I implement a np.linspace so that I can get a continuous 2D function?
I have written my function in the following form:
def f(x):
a = np.array([[2],[6]])
t = lambda x: 3 + np.dot((x - (a)).T, (x - a))
return t(x)
x = np.array([[4],[1]]) # Some random (2,1) sized vector
y = f(x) # Returns an array sized (1,1)
For example, to plot a variation of the function f(x) = x^2 (x-squared) I can write the following code:
def f(x):
return x**2
x = np.linspace(-5, 5, 20)
y = f(x)
plt.plot(x, y)
I want to know whether it is possible to plot a continuous function for a case where x input is two-dimensional vector. If it is not feasible, how the first function should be plotted? A 3-D plot is not possible since my function only has x as its parameter.
Edit:

x?