Plot cylinder symmetry axis
3 views (last 30 days)
Show older comments
gaetano mallardo on 8 Jan 2019
Commented: Raj Gopal Mishra on 26 Jul 2020
I am using the function cylinder to generate a cylinder model. I would like to show the cylinder axis in my plot.
There is a function to rapidly plot the axis or i have to necessary build it and than plot ?
Raj Gopal Mishra on 26 Jul 2020
We can Also plot it with simple Circle patch repeating it for number of times till we get height.
r=1.5; % radius
patch([x -x], [y -y], [z z], 'r')
Star Strider on 8 Jan 2019
I am not certain what you intend by ‘axis’.
If you just want a line through the axis of the cylinder, try this:
[X,Y,Z] = cylinder;
surf(X, Y, Z)
plot3([0 0], [0 0], [-1 2], ':r', 'LineWidth',2)
Experiment to get the result you want.
Star Strider on 9 Jan 2019
As always, my pleasure.
For reference, the cylinderModel class (link) is part of the Computer Vision System Toolbox (link) that I do not have.
I added that and MATLAB to the ‘Products’ tags.
More Answers (0)
Find more on Lighting, Transparency, and Shading 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!