Recreating a mathematical 3D shape

In summary, the conversation discusses the process of recreating a shape shown in an attached photo using MATLAB. The individual has tried to create a 2D shape using a formula, but is struggling to create the desired 3D shape. The conversation then goes on to provide code for creating a 3D shape, adding color and transparency to it, and creating a smoother surface.
  • #1
dan_smith
8
0
Member advised to use the homework template for posts in the homework sections of PF.
Hello, I am trying to recreate a shape shown in the attached photo, from the attached article
I have tried to create this shape in MATLAB as shown in the code bellow ,
from this formula i get a 2D shape and not the shown 3D shape , how to create this 3D shape?
Thankstheta_0=15;
alpha=60;
delta=90;
r0=2.3;
D=15.2;
a=sin(theta_0)/(tan(alpha));
r1=r0*exp(a*phi);

r1=r0*exp(a*phi-pi)
 

Attachments

  • Capture.JPG
    Capture.JPG
    26.6 KB · Views: 362
Physics news on Phys.org
  • #2
%for the other half of the shape
phi=linspace(-pi/2,pi/2,100); %phi can be changed to create different shapes

%convert to cartesian coordinates
x=r1.*cos(phi);
y=r1.*sin(phi);

%plot the shape
figure
plot(x,y,'LineWidth',2)
xlabel('x')
ylabel('y')
axis equal

%to create a 3D shape, we can add a z-coordinate
z=D*phi+delta;

%plot the 3D shape
figure
plot3(x,y,z,'LineWidth',2)
xlabel('x')
ylabel('y')
zlabel('z')
axis equal

%we can also rotate the shape to get different views
figure
rotate3d on
plot3(x,y,z,'LineWidth',2)
xlabel('x')
ylabel('y')
zlabel('z')
axis equal

%to add color to the shape, we can use the 'surf' command
figure
surf(x,y,z,'FaceColor','red','EdgeColor','none')
xlabel('x')
ylabel('y')
zlabel('z')
axis equal

%we can also add transparency to the shape
figure
surf(x,y,z,'FaceColor','red','EdgeColor','none','FaceAlpha',0.5)
xlabel('x')
ylabel('y')
zlabel('z')
axis equal

%to create a smoother surface, we can increase the number of points in phi
phi=linspace(-pi/2,pi/2,1000);

%plot the smoother 3D shape
figure
plot3(x,y,z,'LineWidth',2)
xlabel('x')
ylabel('y')
zlabel('z')
axis equal
 

1. How do you recreate a mathematical 3D shape?

To recreate a mathematical 3D shape, you will need to use mathematical equations and algorithms to define the vertices, edges, and faces of the shape. Then, you can use computer software or 3D modeling programs to create a digital representation of the shape.

2. What is the importance of recreating mathematical 3D shapes?

Recreating mathematical 3D shapes allows for a deeper understanding of spatial relationships and can be used in various fields such as architecture, engineering, and computer graphics. It also allows for the visualization and exploration of complex geometric concepts.

3. What are the challenges in recreating mathematical 3D shapes?

Some challenges in recreating mathematical 3D shapes include accurately defining the shape using equations and algorithms, ensuring the shape is mathematically correct, and accurately representing the shape in a digital form.

4. How do you ensure the accuracy of a recreated mathematical 3D shape?

To ensure the accuracy of a recreated mathematical 3D shape, it is important to carefully define the shape using precise mathematical equations and algorithms. Additionally, using advanced computer software and techniques can help with accurately representing the shape in a digital form.

5. Can mathematical 3D shapes be recreated in the physical world?

Yes, mathematical 3D shapes can be recreated in the physical world through techniques such as 3D printing and CNC machining. However, the accuracy of the physical recreation may depend on the precision of the equipment and materials used.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
7K
Replies
6
Views
4K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
9K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
26K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
275
  • DIY Projects
Replies
5
Views
2K
Replies
29
Views
6K
  • Astronomy and Astrophysics
Replies
4
Views
3K
Back
Top