how can I creat a circle in 2 dim and 3 dim?

1 次查看(过去 30 天)
how can I creat a circle in 2 dim and 3 dim like this:
I need to write a function that gets 2 radious and back those plot.

回答(1 个)

DGM
DGM 2022-1-8
编辑:DGM 2022-1-8
You can always try this:
These are convenient tools with syntax similar to ellipsoid() or sphere(). The output is a set of matrices that can be fed directly to surf() or mesh(). These are fully generalized and support independent axis orders. For a simple circular toroid with circular section:
center = [0 0 0];
radius = [1 1 1 3];
order = [2 2];
npoints = 100;
[x y z] = supertoroid(center,radius,order,npoints);
surf(x,y,z)
shading flat
axis equal
colormap(parula)
view(-16,27)
camlight
or for a toroid with superelliptic profile and section:
radius = [1 1 2 3];
order = [5 3];

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by