Download MuPAD from SciFace

MuPAD Pro Computing Essentials - Examples 

Example 6.6 - Using color function 

In order to use a color scheme defined by a function, we have to define a function that will produce a list of three numbers between 0 and 1. Like the one below:

g := (x,y,z)->[abs(sin(x)), abs(sin(y)), abs(sin(z))]:

Now we can use it in our programs.

export(plot, Function3d):
 
g := (x,y,z)->[abs(sin(x)), abs(sin(y)), abs(sin(z))]:
 
f2 := Function3d(
   cos(x*y),x=0..2*PI, y=0..2*PI,
   Color = [Function, g]
):
 
plot(f2)

Obtained results can be quite impressive. The only thing we have to remember - our color function shall produce list of three real numbers and each of them shall be from the interval [0, 1]. 

 

TOP