Syntax
CPL=CPLcirclesofPL(PL,[r])
Input Parameter
PL : | | Center point list |
r : | | radius of the circles |
Output Parameter
Examples
CPLcirclesofPL(rand(3,2)*10,1)
Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, CPLcirclesofPL
, generates a list of circles based on a list of center points and a specified radius. It is part of the SolidGeometry library.
Input Parameters
- PL: A matrix where each row represents the coordinates of a center point for a circle.
- r: The radius of the circles. This is an optional parameter passed through
varargin
.
Output
- CPL: A matrix representing the closed polygon lines of the circles.
Algorithm Steps
- Determine the number of center points,
nc
, using size(PL,1)
.
- Generate a circle polygon using the function
PLcircle
with the provided radius and other parameters from varargin
.
- Determine the number of points in the circle polygon,
np
, using size(PLi,1)
.
- Initialize the
CPL
matrix with nan
values, sized to accommodate all circles and separators.
- Iterate over each center point:
- For each center point, add the circle polygon points to the
CPL
matrix, offset by the center point coordinates.
- Increment the index
k
to position for the next circle.
- Remove the last row of
CPL
to eliminate the trailing nan
row.
- If no output is requested, plot the center points and the resulting circles using
SGfigure
, PLplot
, and CPLplot
.
Algorithm explaination created using ChatGPT on 2025-08-18 23:15. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21