How to draw a generic cylinder with arbitrary orientation

6 views (last 30 days)
How to draw a generic cylinder, we have its radius, length, position of center of mass ( or bottom face center) and its orientation (using a unit vector, for example 0,0,1 for z-axis ). Any help would be appreciated.

Accepted Answer

Matt J
Matt J on 4 Dec 2023
Edited: Matt J on 4 Dec 2023
See this File Exchange download,
deal([0 0 0], 2, 10, [45 -30]); %Cylinder parameters
gtCyl=cylindricalFit.groundtruth([],cCenter,cRadius,cHeight,cYawPitch); %Data-less ground truth objects
  1 Comment
Mohammad Reza
Mohammad Reza on 24 Dec 2023
Edited: Mohammad Reza on 24 Dec 2023
This is what I learned, in case somebody needs it as well:
Z_axis oriented cylinder: cYawPitch= [0 90]
Y_axis oriented cylinder: cYawPitch= [90 0]
X_axis oriented cylinder: cYawPitch= [0 0]

Sign in to comment.

More Answers (0)


Find more on 2-D and 3-D Plots 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!