Main Content

generateCircleGridPoints

Generate circle grid point locations

Since R2021b

Description

worldPoints = generateCircleGridPoints(patternDims,centerDistance) generates circle grid point locations based on the specified number of circles in each dimension patternDims and the specified distance in world units between the centers of two adjacent circles centerDistance.

For more details on circle grid patterns, see Circle Grid Patterns.

example

worldPoints = generateCircleGridPoints(___,Name=Value) specifies options using one or more name-value arguments in addition to any combination of arguments from previous syntaxes. For example, PatternType="symmetric" sets the pattern type to "symmetric".

Examples

collapse all

Specify the distance between the centers of adjacent circles, in millimeters (mm). By default, the function generates point locations for an asymmetric circle grid.

centerDistance = 9;
worldPoints = generateCircleGridPoints([4 11],centerDistance);

Specify the distance between the centers, in millimeters (mm). Set the pattern type to "symmetric".

centerDistance = 19;
worldPoints = generateCircleGridPoints([8 11],centerDistance, ...
                                        PatternType="symmetric");

Input Arguments

collapse all

Pattern dimensions, specified as a 1-by-2 vector that represents the number of circles in each dimension. For the asymmetric pattern, Dimension 1 corresponds to the number of circles in each column. Dimension 2 corresponds to the total number of circles in the first two adjacent rows. For more details on circle grid patterns, see Circle Grid Patterns.

AsymmetricSymmetric

Asymmetric grid, dimensions 1 is columns, with three circles in every column for a value of 3. Dimension 2 is rows, alternating between three and two circles per row for a value of 5

Symmetric grid, 4 columns and 5 rows.

Distance between centers of two adjacent circles in the same row or column, specified as a scalar in world units, such as millimeters.

Asymmetric grid

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: PatternType="symmetry" sets the pattern type to "symmetry"

Type of circle grid pattern for which the function generates point locations, specified as "asymmetric or "symmetric".

Output Arguments

collapse all

Circle grid center locations, returned as an M-by-2 matrix. Each row of the matrix specifies the xy-coordinates of a circle center relative to the origin. The origin (0,0) is the center of the top-left circle in the grid. M is the total number of circles in the grid,calculated as the product of the circle count in each dimension: prod(patternDims).

Version History

Introduced in R2021b