How can I calculate the coordinates of a hexagon's vertics?

1 次查看(过去 30 天)
I have 3 hexagon in 3 levels.
how can I calculate the coordinate's of these coordinates?
I assume that these 3 level has the same distance from each other.

回答(1 个)

Image Analyst
Image Analyst 2014-1-13
Do you mean like this:
angles = 0:60:360
x = cosd(angles)
y = sind(angles)
nPoints = length(x);
z3 = [ones(1,nPoints), nan, 2*ones(1,nPoints), nan, 3*ones(1,nPoints)]
x3 = [x, nan, x, nan, x];
y3 = [y, nan, y, nan, y];
plot3(x3, y3, z3, 'b-', 'LineWidth', 4);
grid on;
Which creates 3 hexagons separated in three different Z levels?

Community Treasure Hunt

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

Start Hunting!

Translated by