[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to compute the surface defined by a given contour?
From: |
Ben Abbott |
Subject: |
Re: how to compute the surface defined by a given contour? |
Date: |
Fri, 10 Dec 2010 20:17:50 -0500 |
On Dec 10, 2010, at 9:29 AM, trophime wrote:
> Hi,
> I am a newbie to octave.
> I have X Y Z data. I have manage to plot contour of Z as a function of
> X,Y using something like :
>
> x = linspace(0, 0.1197, 101);
> y = linspace(0.113258, 0.377527, 101);
> Z = load("data");
>
> [X,Y] = meshgrid(x, y);
> surf(X,Y,Z)
> contour (X, Y, Z)
>
> Then I have selected a given contour :
>
> VN = [0.5, 0.5];
> contour (Z, VN);
> [C, LEV] = contourc (X, Y, Z, VN);
>
> Now I would like to get the surface (in the (X,Y) plane) defined by this
> contour?
> Is it possible to compute the gravity point of the contour?
>
> Thanks for your helps
If I understand what you'd like to do, an approximation to the center of
gravity can be calculated as ...
center = sum (((X+1i*Y).*Z)(:)) / sum (Z(:))
x_center = real (center)
y_center = imag (center)
Ben