File Exchange

image thumbnail


version (1.51 KB) by Waldemar Swiercz
3D cone connecting 2 points


Updated 30 Oct 2008

No License

This is an update of code plotting Cylinder by Divahar Jayaraman
it simply plots the cylinder with different radius values for top and bottom.

Cite As

Waldemar Swiercz (2021). Cone (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Seongyeon Lee

Thank you so much for an awesome code!

Manu Francis

Thanks a lot for your code. I have a cone as in your code, means I know peak point(X1), base point(X2), radius etc. If I get a point(x1,y1,z1), how can I check is that point inside or outside this cone ? Thanks in advance.


Awesome code. Just a small bug when the direction of the cone is exactly [-1 0 0] since the cross product with unit_Vx is [0 0 0] so the cone is not drawn. I solved it in my application (not very elegantly though) adding this:
if isequal((X2-X1),-unit_Vx);
axis_rot = [0 0 1];


Walton Coutinho

Thanks for the code!

Nima Moshtagh

Thanks for the code!

MATLAB Release Compatibility
Created with R13SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Inspired by: Cylinder

Inspired: pigeon.m

Community Treasure Hunt

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

Start Hunting!