![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/287573/image.png)
triangulation between two circles
5 views (last 30 days)
Show older comments
Hi:
I have two circiles which is constructed by points.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/287570/image.jpeg)
With the known coordinated of the points on these two circles respectively, is there anyway generate the triangulation information like figures shown below?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/287571/image.jpeg)
The goal is not to plot the lines that construct the triangles between two circles, I need the triangulation information, i.e. the connectivity that construct those triangles by the node ID.
which is very similiar with the output of function 'triangulation':
Thanks!
Yu
0 Comments
Answers (1)
Image Analyst
on 26 Apr 2020
Try this and adapt as needed:
numPoints = 50;
theta = linspace(0, 360, numPoints);
deltaTheta = (theta(2) - theta(1)) / 2
radius1 = 300;
radius2 = 400;
xInner = radius1 * cosd(theta);
yInner = radius1 * sind(theta);
plot(xInner, yInner, 'r.-', 'MarkerSize', 15, 'LineWidth', 2);
hold on;
theta2 = theta + deltaTheta;
xOuter = radius2 * cosd(theta2);
yOuter = radius2 * sind(theta2);
plot(xOuter, yOuter, 'r.-', 'MarkerSize', 15, 'LineWidth', 2);
% Plot lines between them
% Need [xinner(1), yInner(1);
% xOuter(1), yOuter(1);
% xinner(2), yInner(2);
% xOuter(2), yOuter(2);
% Interleave the arrays
row = 1;
for k = 1 : length(xInner)
xBoth(row) = xInner(k);
xBoth(row+1) = xOuter(k);
yBoth(row) = yInner(k);
yBoth(row+1) = yOuter(k);
row = row + 2;
end
plot(xBoth, yBoth, 'b-', 'LineWidth', 1);
axis('on', 'square');
grid on;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/287573/image.png)
See Also
Categories
Find more on Triangulation Representation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!