Question

Write a MATLAB script that computes the surface area of a function

  1. Write a MATLAB script that computes the surface area of a function
0 0
Answer #1

Note : There is no MATLAB function which calculates surface area of the surface directly over any plane.However,it can be

calculated by splitting the rectangular or square grids into triangular pieces and adding them together.

Solution : If the coordinates of the vertices of triangle in three-dimensional space are given by Vi=(Xi,Yi,Zi), then area can be calculated by ;

Area(A) = 1/2* |(v2-v1) \times (v3-v1)|

Similarly,

SURFACE AREA OF f(x,y) :

[x,y] = peaks;

[m,n] = zeros(z);

area = 0;

for i = 1:m-1

for j = 1:n-1

v0 = [x(i,j) y(i,j) ];

v1 = [x(i,j+1) y(i,j+1) ];

v2 = [x(i+1,j) y(i+1,j)];

v3 = [x(i+1,j+1) y(i+1,j+1)];

a = v1 - v0;

b = v2 - v0;

c = v3 - v0;

A = 1/2*(norm(cross(a, c)) + norm(cross(b, c)));

area = area + A;

end

end

fprintf('\n Total area is: %f\n\n', area);

Know the answer?
Add Answer to:
Write a MATLAB script that computes the surface area of a function
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT