cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

## 3D Plots and Volume Alexandrite

## 3D Plots and Volume

Hello to all,

I am starting to explore the world of 3D plots in MathCAD.

I am relatively comfortable with 2D xy plots and creating graphs and evaluating them etc by using xy data and applying a polynomial function to extrapolate a curve from said plots. I am also comfortable with evaluating the area under the curve produced in this way with various integrals.

I am not looking at how challenging it may be to add the 3rd dimension i.e. if I have a variety of xyz data plots, how hard is it to plot them into a 3D plot and to bound a volume within them? Further how challenging is it to evaluate the volume within i.e. to find the centroid of the volume etc?

Thanks,

Andy.

10 REPLIES 10 Emerald V
(in response to awibroe)

## Re: 3D Plots and Volume

http://twt.mpei.ac.ru/MCS/Worksheets/Regress-z-x-y.xmcd

We have data as point on the syrface an needet value as cross-hair on the 3D plot

If it is what you need I can send the sheet! Emerald V
(in response to ValeryOchkov)

## Re: 3D Plots and Volume

But better is the using not a surface but a set of curves

http://twt.mpei.ac.ru/MCS/Worksheets/Interp-f-x-y.xmcd Alexandrite
(in response to ValeryOchkov)

## Re: 3D Plots and Volume

Hi Valery,

Impressive! I think what I am after is being able to plot a variety of scatter points where I have a series of x, y and z data similar to your website.

I am then looking to see how I can 'connect' these to make a surface around these points and then to evaluate the space within the surface. Does that make sense?

I have been experimenting with simple shapes i.e. a cube. Where I have 8 points of a cube defined by their respective x,y,z points. When I try to plot these I only seem to be able to add z axis data not x or y data?

Andy. Sapphire III
(in response to awibroe)

## Re: 3D Plots and Volume

Attach the worksheet with your attempt and explain what you mean with 'adding data'.

Luc

P.S. You may need to put your worksheet in a .zip file in order to attach it. And I'm assuming you're using Mathcad, not Prime, since the 3D plotting capabilities of Prime still leave too much to desire. Alexandrite
(in response to LucMeekes)

## Re: 3D Plots and Volume

Hi Luc,

Allas, I am using Prime as that is what I am comfortable with. I have MC15 as a bye product of buying prime but never got to grips with it.

I am really just trying to get to grips with what is possible in MathCAD. As part of a larger Project I am trying to plot a 3D shape defined by a variety of points (with known x,y,z) dimensions (from the origin). For example in the attached I have 2 squares which I am trying to get to form the sides of a cube which I can then evaluate i.e. volume, centroid location etc. I am interested to know what the criteria is for surface fill to work and also for giving units i.e. when I add units I get an error message.

Cheers

Andy.

PS Remind me how to attach a MC file? Sapphire III
(in response to awibroe)

## Re: 3D Plots and Volume

Use the 'browse' button, just below the typing pane.

In order to zip the file, use the windows File Explorer and, with the right-mouse button on the Mathcad sheet file,  select 'send to' => 'compressed (zipped) folder. Then you get a .zip file next to the Mathcad sheet file.

Success!
Luc Alexandrite
(in response to LucMeekes)

## Re: 3D Plots and Volume Opal
(in response to awibroe)

## Re: 3D Plots and Volume

Hi,

Is this what you are after.

You need to find the volume of a "tetrahedra".in terms of its four corner p,u,v,w expressed as (x y z) row vectors. this can be done with cross and dot products of vectors.

Then there are 5 tetrahedra that make up the "cubic" volume defined by the eight corners..

In this way the volume can be derived if it is not exactly cubic. This is how to do it in scilab

```function vol=tetra(p, u, v, w)
uvw=cross((w-u),(v-u))
vol = abs(dot(uvw,-p)-dot(uvw,-u))/6.0
endfunction```
```function s=brick8(i, j, k, l, m, n, o, p)
s = tetra(i,m,n,p);
s = s + tetra(k,o,n,p);
s = s + tetra(n,j,k,i);
s = s + tetra(p,l,k,i);
s = s + tetra(k,i,n,p);
endfunction```

I have not changed this to Mathcad but can do if this is really what you are after.  It does not provide the centroid. Opal
(in response to awibroe)

## Re: 3D Plots and Volume

Hi,

Here is the Prime version of the "cubic" volume calculation.  It is important you keep the order of the points. Opal
(in response to awibroe)

## Re: 3D Plots and Volume

Hi

Final Prime 4.0 sheet that calculates the volume and centroid of cubic volumes anywhere in 3D space.