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

1 view (last 30 days)
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 Comment
Image Analyst
Image Analyst on 13 Jan 2014
Define "have". If you don't have the coordinates , then exactly what do you "have"?

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 13 Jan 2014
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!