Generate a point cloud on an equilateral triangle 2 - MATLAB Cody - MATLAB Central

Problem 60461. Generate a point cloud on an equilateral triangle 2

Difficulty:Rate
The input is the iteration parameter H.
The output is a point cloud W involving N points.
W is N uniformly distributed points on an equilateral triangle.
The side length of an equilateral triangle is 2.
The relationship between H and N is as follows:
  • H = [1 2 3 4 5 6 7 8 9];
  • N = [4 10 19 31 46 64 85 109 136];
The results for cases where H is 1 to 6 are as follows.
Ex)
  • [W,N] = lattice2(H=1) -> W = [0 0; 1 sqrt(3)/3; 1 sqrt(3); 2 0]; N = 4;
  • [W,N] = lattice2(H=2) -> W = [0 0; 0.5 sqrt(3)/6; 0.5 sqrt(3)/2; 1 0; 1 sqrt(3)/3; 1 sqrt(4/3); 1 sqrt(3); 1.5 sqrt(3)/6; 1.5 sqrt(3)/2; 2 0]; N = 10;

Solution Stats

37.5% Correct | 62.5% Incorrect
Last Solution submitted on Feb 23, 2025

Solution Comments

Show comments
Who Deserves Your Praise? Discover the New Contribution Widget!
...
We are excited to announce another update to our Discussions area: the...

Problem Recent Solvers3

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!
Go to top of page