Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Generate Cylinder with random points

Subject: Generate Cylinder with random points

From: Deepak

Date: 15 Feb, 2011 16:30:10

Message: 1 of 3

Hi,

Am trying to generate a cloud of random points in the shape of a cylinder of radius r and height h. The points should not deviate too much from the surface of the cylinder.

Can someone please help.

Thanks

Subject: Generate Cylinder with random points

From: Sean de

Date: 15 Feb, 2011 17:40:10

Message: 2 of 3

"Deepak " <deepak.tss@gmail.com> wrote in message
> Am trying to generate a cloud of random points in the shape of a cylinder of radius r and height h. The points should not deviate too much from the surface of the cylinder.


num_points = number_of_points_you_want;
h = rand(num_points,1)*hmax; %height mac=x
r = r_ideal+(rand(num_points,1)-.5)*noise_scale; %r_ideal = ideal radius; noise_scale= deviation

%You'd probably also want a theta:
theta_degrees = 360*rand(num_points,1);

%SCd

Subject: Generate Cylinder with random points

From: Deepak

Date: 15 Feb, 2011 19:06:04

Message: 3 of 3

"Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <ijedpq$471$1@fred.mathworks.com>...
> "Deepak " <deepak.tss@gmail.com> wrote in message
> > Am trying to generate a cloud of random points in the shape of a cylinder of radius r and height h. The points should not deviate too much from the surface of the cylinder.
>
>
> num_points = number_of_points_you_want;
> h = rand(num_points,1)*hmax; %height mac=x
> r = r_ideal+(rand(num_points,1)-.5)*noise_scale; %r_ideal = ideal radius; noise_scale= deviation
>
> %You'd probably also want a theta:
> theta_degrees = 360*rand(num_points,1);
>
> %SCd

Thank You. Exactly what i needed.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us