# Question:How to paint 3D plots with a sophisticated colorfunc?

## Question:How to paint 3D plots with a sophisticated colorfunc?

Maple

I've been tasked with generating "phase plots" which are visualizations of complex functions.

A 2D phase plot is easy to create: Given a complex function F : C -> C colour points (x, y) in R^2 by [ arg(F(x+I*y)), 1, 1, colortype=HSV].   Something like the following seems to do the trick

```p := plot3d(          1,         x=-5..5,         y=-5..5,         scaling=constrained,         color=[ argument(f(x+I*y))/2/Pi, 1, 1, colortype=HSV],         axes=none,         style=patchnogrid,     ):```
```         g := plottools[transform]((x,y,z)->[x,y],p);     plots[display]( g(p) ):```

Now, "colouring each point of R^2" is only possible using some type of bijection onto the Riemann sphere or Pseudosphere.

The pseudosphere is:

```    x := (u,v) -> sech(u)*cos(v);     y := sech(u)*sin(v);     z := u - tanh(u);          return  plot3d(         [x(u,v),y(u,v),z(u,v)],         u=0..3,         v=0..2*Pi,         numpoints=2^10,         lightmodel=none,         color=ColorFunc(u,v) );```

In this case I need  ColorFunc to be:

```ColorFunc := proc(u,v)     x, y := v, exp(u);     ans  := Re( f(x+I*y) );     if ans > 2*Pi then        return [0,0,0,colortype=HSV];     end if;     return [ans/2/Pi,1,1,colortype=HSV]; end proc;```

But it seems that "ColorFunc" cannot be very sophisticated.  Namely, it cannot contain "frems" or even "if" statements because (as far as I can tell) of the order of evaluations.

It seems possible that I can generate a psuedosphere then change colours AFTER by swapping out the COLOR information in a more sophisticated way.  How can I do this?  I really just need to know how to identify and swap out points from a MESH.

﻿