circles - rectangle intersection area

A fast function which calculate the intersection area of a circle in a large rectangle.
540 Downloads
Updated 15 Oct 2012

View License

this function takes a list of circles centered (xcenter, ycenter) with radius r
and calculate the relative area in the rectangle with size xmax/ymax 1024x1024.
rectangle size can be changed
main strength of this function is by its speed of calculation.
average computation time is about 0.3s for 10000 circles.This was achieved by aproximating the circle area into
%3rd order polynoms instead of integrating
%the circle equation for finding the area below the axis.
example
x=1024*rand(1,10000);
y=1024*rand(1,10000);
radius=50;
tic; Result_V=compute_circle_area2(x,y,radius);
toc; %Elapsed time is 0.193961 seconds.
clarification:
The function "DistancePoints" used here was downloaded from “geom2d” package created by David Legland.

Cite As

Doron avramov (2024). circles - rectangle intersection area (https://www.mathworks.com/matlabcentral/fileexchange/38463-circles-rectangle-intersection-area), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Denoising and Compression in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.3.0.0

clarification:
The function "DistancePoints" used here was downloaded from “geom2d” package created by David Legland.

1.1.0.0

bug fixed

1.0.0.0