varea.m
No License
Compute the area and judge the direction of a closed curve.
function area=varea(C)
%VAREA compute the "sign-area" of a closed curve.
% NOTE: Sign-area equals to the area of the closed curve when it is in anti-clockwise and equals to the negative area when it is in clockwise.
% Negative area means equal to area in magnitude but is negtive in sign.We can see that this script may also be used to judge the direction of a closed curve.
% C provides the coordinats of the nodes of the curve in the following way:
% C=[x1 x2 ...
% y1 y2 ...]
% AREA=VAREA(C)
% AREA returns the area of the curve(>0) when it is in anti-clockwise
% AREA returns the negtive area of the curve(<0) when it is in clockwise
Cite As
Kang Zhao (2024). varea.m (https://www.mathworks.com/matlabcentral/fileexchange/3284-varea-m), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > 2-D and 3-D Plots > Vector Fields >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |