[Scilab-users] How to plot 3d implicit surface
Martin Helm
martin at null-a.de
Sun Nov 25 03:01:49 CET 2012
Am 25.11.2012 01:32, schrieb Martin Helm:
> I found this one
> http://www.scilab.org/contrib/index_contrib.php?page=displayContribution&fileID=1236
> have not tested it yet but looks promising.
I tested it now: Take the function contour3d.sci from the link above. It
seems to be an old function which uses a few deprecated function calls.
You need to change line 36 and replace xbas() with gcf() in addition you
need to replace in line 82 sort with gsort.
Now you can run the following simple test
function val = isotest(x, y,z)
val = x.^2+y.^2+x+y+x.*y+z.^2-1;
endfunction
clf();
x = linspace(-2, 2, 31);
y = x;
z = x;
[X Y Z] = meshgrid(x,y,z);
val = isotest(X, Y, Z);
contour3d(X, Y, Z, val, 0)
f = gcf();
f.color_map = [1 0 0]; // make the black surface red
which will draw your implicit function in red. This will work for all
kind of implicit functions as long as your discretisation is fine enough.
Hope that helps.
More information about the users
mailing list