Hi Hermes,


One simple way is to display the 0-contour level of your "heart" function:



// START OF CODE

nx = 300;

ny = 200;

X0 = linspace(-1.2,1.2,nx);

Y0 = linspace(-1.5,2,ny);

X= X0.*.ones(ny,1);

Y= (Y0.*.ones(nx,1))';

Z = (1.2*Y - sqrt(abs(X))).^2 + X.^2 - 1;  // Heart function

clf()

a=gca();

a.x_label.text=" X";

a.y_label.text=" Y";

contour(X0,Y0,Z',[0  0]);

a.view = "2d";

// END OF CODE



Exercise:  fill it in red...



Regards,

Rafael



-----Original Message-----
From: users [mailto:[email protected]] On Behalf Of Hermes
Sent: Tuesday, September 26, 2017 9:48 AM
To: [email protected]
Subject: [Scilab-users] Plot Heart Curve in Scilab



Hello,

I've been looking at the forum, how to graph the following function:



x2=[-2:0.01:2];x1=[-1:0.01:1];

function val = Heart(x1, x2)

    val=(1.2*x2-sqrt(abs(x1)))^2+x1^2-1;

endfunction



And I have not found anything to guide me. Please, could you help me?



<http://mailinglists.scilab.org/file/t497622/Heartcurve.jpg>



Gracias







--

Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html

_______________________________________________

users mailing list

[email protected]<mailto:[email protected]>

http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to