Example for creating and rotating of a mathematical function in a script
Your Animation Nodes Node Setup would look like this:



Basically it takes a generated grid mesh and deforms it with your functions to your 3D object which also gets constructed at the end. I used Math Nodes everywhere, but if you find out how you could use expressions or phython scripts to do that. The problem which I faced with expressions was the type being a list. Math Nodes handle that automatically so you dont have to worry about that. The generated Object would look like this: