MATLAB: Draw a 3D aerodynamic nose cone

3d plotscylinderMATLABmatlab function

Hi everybody!
I'm trying to draw a bullet. For this, i need 2 pieces: the bullet body and the ogive. I know how to plot the cylinder for the bullet body but I struggle to plot the ogive with the corresponding radius…
I am using this relation for a 3D parabolic ogive:
*
Here's my code:
x = 0:1:10;
K = 0.75;
d = 5;
R = d/2; % radius - same as the radius of the bullet body
Lo = 10; % ogive length
% parabolic ogive equation
y=R*((2*(x/Lo)-K*(x/Lo).^2)/(2-K));
% 3D representation
[X,Y,Z] = cylinder(y);
X=X*R/2;
Y=Y*R/2;
Z=Z*Lo;
surf(X,Y,Z);axis equal;
the result:
The problem is I don't think the code is right and the result neither. In fact the diameter of the circle is more than 5 and I don't know why. Can you help me understand this cylinder function ? Thanks 🙂

Best Answer

  • Instead of
    X=X*R/2;
    Y=Y*R/2;
    use
    X=X*R/max(y);
    Y=Y*R/max(y);