Generate random 3D coordinates in a cylinder
Show older comments
I want to generate a set of 1000 3D points (x,y,z) which are located inside a cylinder of radius r and centre axis from [x1,y1,z1] to [x2,y2,z2]. Any ideas?
Accepted Answer
More Answers (1)
Vu Ngoc Quang
on 18 Feb 2019
0 votes
Everyone can help me
Write Matlap code that generates 3-D coordinates of 50 points (evenly distributed). These points have the same length of 26371Km. This is the first time that I learn Matlap. So please help?
1 Comment
Image Analyst
on 18 Feb 2019
Edited: Image Analyst
on 18 Feb 2019
What does evenly distributed mean to you? Random according to a uniform distribution (like raindrops on the ground), or in a regular grid like a rectangular grid or a honeycomb grid?
For a grid (of some kind) you could do
array3d = zeros(rows, columns, slices);
indexes = round(linspace(1, numel(array3d), 50));
array3d(indexes) = 1;
Categories
Find more on Texas Instruments C2000 Processors 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!