Re: Hello, How I can calculate an area (or surface) of a points list? And perimeter?
- To: mathgroup@smc.vnet.net
- Subject: [mg11678] Re: [mg11607] Hello, How I can calculate an area (or surface) of a points list? And perimeter?
- From: Sean Ross <seanross@worldnet.att.net>
- Date: Sat, 21 Mar 1998 18:35:14 -0500
- References: <199803200048.TAA05579@smc.vnet.net.>
Joan Garcia wrote: > > Hello, > > I don't know how I can calculate an area (or surface) of a points list. > How I can to do this? > > I have a points list, this list define a surface (similar a star), I > want know the surface. > > Thanks First, you must decide what you mean by surface area and what your data represents. Does your data represent points on a smooth surface? If so, how do you define smooth and by what Interpolation order? Your data could also represent the axes of a set of triangles. If the data is triangles, then you need to sum their areas all up. The programming challenge will be to determine the correct pairs. A general approach would be to first make your list of {x,y,z} data points into a continuous function via Interpolation, such as Clear[f] ftable=Flatten[Table[{xx,yy,Sin[xx+ yy]},{xx,0,2 Pi,.1},{yy,0,2 Pi,.1}],1]; f=Interpolation[ftable,InterpolationOrder->1]; Now you need to apply a surface integration to the function f[x,y]. The equation to do this can be found in introductory calculus texts: NIntegrate[Evaluate[Sqrt[D[f[x,y],x]^2+D[f[x,y],y]^2 +1]],{x,0,6.1},{y,0,6.1}] Note that this last formula is intended to be a general formula, not the code you actually use to solve the problem. The code works, but takes forever due to the oscillatory nature of this particular integrand. You will probably want to make a numerical integration of your own method for the actual implementation. -- Remove the _nospam_ in the return address to respond.