1

How many dimensions u need to visualize a vector valued function For example function f(x)=x^2 can be visualized in 2D f(x,y)=xy can be visualized in 3D but what about function like f(x,y)=(x^2-y^2,2xy) having two inputs and two outputs is this thing visualized in 4D?

Feather
  • 41

3 Answers3

7

You just draw the vector $(x^2-y^2,2xy)$ at position $(x,y)$:

enter image description here

Michael Hoppe
  • 18,103
  • 3
  • 32
  • 49
  • Is drawing vector field and applying transformation such that each point x get mapped to x^2-y^2 and y getting mapped to 2xy is same thing!?? – Feather Jul 10 '23 at 12:32
  • 3
    Each point $(x,y)$ of the domain of $f$ is assigned to a vector $f(x,y)$. – Michael Hoppe Jul 10 '23 at 16:44
  • 3
    @Feather: vector fields and coordinate transformations are only the same “thing” in terms of their input/output dimension counts. Coordinate transformations change the shape of a region, while vector fields attach a vector to each point of the domain. – Matthew Leingang Jul 10 '23 at 18:24
  • 1
    As written, this is not the best idea for a visualization. Normally when you see an array of arrows on a graph, the arrows indicate the velocity at which which a particle at the source is traveling. It could also represent some field of force, but even then it indicates how particles at the source will move. Thus, readers will likely be misled by their previous experience, and interpret the vector field differently than intended. You can fix this (mostly) by making the vector $$(x^2-y^2,2xy) - (x,y) = (x^2-y^2-x,2xy-y)$$ instead. I.e., its source is at $(x,y)$ and head is at $(x^2 - y^2, 2xy)$ – Paul Sinclair Jul 10 '23 at 19:39
  • 1
    Some of us take issue with that "just". :-P Vector field visualization is/was a whole area of research. – Pablo H Jul 10 '23 at 20:03
  • @MatthewLeingang - Coordinate transformations change the shape of a region, while vector fields attach a vector to each point of the domain.- so they give 'different ' visualization !! One transform the space n other just attach vector to every point like fluid flow so both different interpretation will give the same thing !? Same concept !? Always!? – Feather Jul 11 '23 at 05:39
  • @PaulSinclair what about transformations !? In which we consider the movement of x and y coordinate from input space to output space ! I don't know why but that doesn't sit right with me ! Transformations and fluidflow(adding vectors to each point) seems like two very different visualizations of same things!? – Feather Jul 11 '23 at 05:42
  • 1
    @Feather - In a fluidflow, the vectors represent the velocity of the fluid. If you either ignore the variance caused by changes in the velocity of the particle as it travels over a short period, or use velocity over discrete time periods rather than instantaneous velocity, then the difference between the current location of particles, and their location after one period is a transformation. And the arrows depicting that transformation as I described are exactly the same as the velocities. These are not unrelated depictions, they are in fact almost the same thing. – Paul Sinclair Jul 11 '23 at 21:28
3

The number of dimensions you need to truly visualize functions is exactly equal to the sum of the input dimensions and output dimensions. For instance, your function $f(x,y) = xy$ has two input dimensions (e.g. $x$ and $y$), and one output dimension (say, the $z$ dimension in $z = f(x,y) = xy$). So, you'll need three dimensions to properly visualize this function.

Likewise, in your next example, $f(x,y)=(x^2-y^2,2xy)$, you have the same two input dimensions, but now you also have two output dimensions. If they need labeled, you could say the $w,z$ dimensions in $(w,z) = f(x,y)$. So, you'll need to be in a four-dimensional space to properly visualize this function.

However, there are some other tricks in order to plot things so that we can understand them. For instance, utilizing vector fields like in the other two answers is a common solution. Rather than tacking two entire dimensions onto each point in your input plane, and drawing a single vector within each, we instead can place a scaled copy of each vector with its tail on the point in question. This saves a number of output dimensions by aligning them with the input dimensions.

Another trick is to make use of non-spatial dimensions. If you only consider a fixed range for some of your output dimensions, you can plot the output in colour as well. In fact, you can save up to three output dimensions by mapping each of $(x,y,z)$ to a channel in an RGB value representing a colour (i.e. $R=x$, $G=y$, $B=z$). Alternatively you could think about what happens to your function as a parameter varies in time. For instance $f(x,y) = (xy, x+y)$ can not normally be visualized in $\mathbb{R}^3$, but if instead you consider $f(x,t) = (tx, x+t)$, you can fit this easily into three spatial dimensions by letting $t$ vary through time.

Logan
  • 33
2

In the case of a function $f:\mathbb{R}^2\to\mathbb{R}^2$, you can think of $f(x)$ as a vector in $\mathbb{R}^2$, starting at the point $x\in\mathbb{R}^2$ with direction given by $f(x)$, hence drawing the vector field.

Notice that, in general, when $f:\mathbb{R}^n\to\mathbb{R}^m$ is such that $n+m>3$ we can't represent the graph of $f$. For example, a torus is actually the image (not the graph!) of a specific function.

Sandro
  • 176