Finds convex polygon defined by random 2D points

Finds convex polygon defined by random 2D points
1.5K Downloads
Updated 13 Feb 2007

No License

The function "Return_points_polyg_direct" finds the subset of an arbitrarily large set of 2D points. This subset defines the convex polygon that includes all above points. The function accounts for aligned or identical points.
Below is an example of how to use the function with 100 random 2D points.
The initial points are in blue, the convex polygon points are linked in red.

******************
clear;
nouv_list_points3D=[];
Npoints=100;

%construction d'un ensemble de N points aléatoires

list_points_3D=rand(2,Npoints);

ligneZ=zeros(1,Npoints);

list_points_3D=cat(1,list_points_3D,ligneZ);

plot(list_points_3D(1,:),list_points_3D(2,:));

nouv_list_points3D = Return_points_polyg_direct(list_points_3D);

line(nouv_list_points3D(1,:),nouv_list_points3D(2,:),'LineWidth',1,'Color','red','Marker','s','MarkerSize',4);

Cite As

christian delusier (2024). Finds convex polygon defined by random 2D points (https://www.mathworks.com/matlabcentral/fileexchange/13940-finds-convex-polygon-defined-by-random-2d-points), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Computational Geometry 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.0.0.0