Hi, I was wondering how to create a piecewise function of two variables
r(x,y) = \begin{cases} f(x,y) & d(x,y)\geq 0 \\ g(x,y) & d(x,y)<0\end{cases} and use it to plot the coordinate pair (x',y')= (m(x,y), n(x,y)) on xy- plane where both m and n are scalar [but also functions of r(x,y)].
So far I thought of creating x= -10:10 and y : -10:10 and to store their values in arrays and then just output array of m and n values. Is it the correct thought process? End goal is to plot (m,n) based on (x,y) based on different values of a. Sorry for the basic doubts. Any help is appreciated. Thanks.
a= 1/2
g(x) = a*x^2
function p(y)
return -(2a*y-1)^2
end
function q(x,y)
return ((2a*y-1)^3-(27a^2)*(x^2))
end
function del(x,y)
return (a^2*x^2-2(a*y-1)^3)*x^2
end
function r(x,y)
if all(del(x,y) .>= 0)
return -(a*y+1)./(3a)
else
return (a*y+1)./(3a)
end
end
x = range(0, 50, length=100);
y = range(0, 50, length=100);
#plot(m,n)??