0

I have this 3D shape which can be separated into 9 regions (i.e. pieces) as follows:

enter image description here

From the top it looks like this:

enter image description here

I would like to represent this shape as a 2D piecewise function (i.e. f(x,y)) like it was done here

In my case, I have the following:

  • Region 1: Inclination through x
  • Region 2: Intersection between x and y
  • Region 3: Inclination through y
  • Region 4: Intersection between x and y
  • Region 5: Inclination through x
  • Region 6: Intersection between x and y
  • Region 7: Inclination through x
  • Region 8: Intersection between x and y
  • Region 9: 1 & Top section

If I include the boundaries then it will become like this:

enter image description here

Region 9 is the top section so the f(x,y) will be 1, but I would like to represent each section as piecewise. I am unsure how to interpret another region.

The end goal is to plot f(x,y) as a surface like this (this can be done easily if f(x,y) is defined):

% Grid points spanning from -1 to 2 for x and y:
[x, y] = meshgrid(linspace(-1, 2, 91));

% Fill Z with zeroes to start (satisfies condition 1 by default):
Z = zeros(size(x));

% Region 1:
index = (x >= 0) & (x <= vx) & (vy >= 0) & (y <= h);
Z(index) = %some function

% Region 2:
index = (x >= 0) & (x <= vx) & (vy >= 0) & (y <= vy);
Z(index) = %some function

% Region 3:
index = (x >= vx) & (x <= w) & (vy >= 0) & (y <= vy);
Z(index) = %some function

% Region 4:
index = (x >= w) & (x <= vx) & (vy >= 0) & (y <= vy);
Z(index) = %some function

% Region 5:
index = (x >= w) & (x <= w+vx) & (vy >= vy) & (y <= h);
Z(index) = %some function

% Region 6:
index = (x >= w) & (x <= vx) & (vy >= h) & (y <= h+vy);
Z(index) = %some function

% Region 7:
index = (x >= vx) & (x <= w) & (vy >= h) & (y <= h+vy);
Z(index) = %some function

% Region 8:
index = (x >= 0) & (x <= vx) & (vy >= h) & (y <= h+vy);
Z(index) = %some function

% Region 9:
index = (x >= vx) & (x <= w) & (vy >= vy) & (y <= h);
Z(index) = %some function


% Plot surface:
surf(x, y, Z, 'EdgeColor', 'none');

How to write f(x,y) on paper?

Sami
  • 341
  • 7
  • 22

0 Answers0