Menu

Example functions

David Llewellyn-Jones
Attachments
CartesianSin01.png (33906 bytes)
EditCartesian01.png (15633 bytes)
EditCartesian02.png (16393 bytes)
EditCartesian03.png (16086 bytes)
EditCartesian04.png (54954 bytes)
EditCartesian05.png (17545 bytes)
EditCartesian06.png (74629 bytes)
SinCosin01.png (45501 bytes)

Here are some example functions, to give you an idea of the sort of algebraic expressions you can use when creating surfaces in Functy.

One of the most important things to realise about Functy is that, in Functy, everything is a function. If you can enter a value for something, then most likely you can enter a function for it.

So, if functions are the currency of Functy, then it's a good idea to get familiar with them.

Let's start by looking at sines and cosines. These are some of the most important functions for a number of reasons, not least because they can generate some nice, smooth, differentiable and periodic curves.

In their two dimensional forms, sines and cosines look like this.

2D sin and cosine curves

In order to use this function with Functy, it has to be applied to a three dimensional surface. There are lots of ways to do this, but the easiest is probably to use it to specify the height of a Cartesian surface.

If you create a Cartesian plane, its edit window will initially look like the following.

Editing the function for a Cartesian surface

The Function field allows you to specify the height of the surface above the x-y plane using the variables x and y (representing the position on the plane) and t (representing time). We're going to set the height to be equal to sin(y), which we can do by filling out the function field as follows.

Setting the function for a Cartesian surface to be sin(y)

If you do this, you should end up with a surface that looks something like this. Note that you may have to zoom in or out and transalte the graph to get something that looks exactly like this, however you should have something that approximates it.

Cartesian surface representing sin(y)

This example uses only the y position to determine the height of the surface. However, you can mix different variables with more complex expressions for the function to create more varied surfaces. For example, suppose we multiply the previous function by cos(x), as shown below.

Creating the function sin(y)*cos(x)

The you would generate an undulating surface that should look similar to the following.

Cartesian surface representing sin(y)*cos(x)

However, it's not just the shape of the surface that you have control over. You can also change the colours used across the surface using similar functions as well. Clicking on the Colour tab in the window will bring up a new set of fields that can be filled out to represent the colour. You can select a specific colour for the entire surface by clicking on the colour selection rectangle. However, you can also specify the colour based on a function, similar to that shown below.

Cartesian surface colour editing

You can use any function of x, y, z (for the height) and t for time when constructing your functions. The functions shown in the window above should generate a surface colouring similar to the following.

Coloured Cartesian surface


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.