how to draw a hyperboloid?
이전 댓글 표시
Hai,
I need to draw a hyperboloid in matlab. How is it I could do it?
BSD
댓글 수: 6
Fangjun Jiang
2011년 9월 25일
If you run membrane, is the figure that comes out close to what you want?
bsd
2011년 9월 25일
Fangjun Jiang
2011년 9월 25일
Run membrane in Command Window to see.
bsd
2011년 9월 25일
Fangjun Jiang
2011년 9월 25일
Then you need to explain what is hyperboloid and what you want to do. I can search for hyperboloid and it gives me lots of hits. For your benefit, barely mention hyperboloid in your question is not sufficient, right?
bsd
2011년 9월 25일
채택된 답변
추가 답변 (3개)
HAGOS EMAN
2019년 6월 18일
1 개 추천
Thanking you all! Very helpful!
Fangjun Jiang
2011년 9월 25일
As long as you have the mathematical equation describing that hyperboloid, you should be able to generate some data and then draw it.
Take a unit sphere for example, the equation is x^2+y^2+z^2=1; If you carefully set the mesh grid for x and y, then you can calculate the corresponding value for z. Then you can use surf() to plot it.
MATLAB has the sphere() function. Here I am using it to generate the data first and then plot it. Running sphere alone can plot it too.
[x,y,z]=sphere;
surf(x,y,z)
Chaowei Chen
2011년 9월 25일
0 개 추천
[x,y]=meshgrid(-10:10);
r_sq=x.^2+y.^2;
z=sqrt(r_sq+1);
surf(x,y,z)
댓글 수: 2
Bud Kelly
2018년 3월 30일
This is very clever. Thank you, I will keep it for reference. I had thought that you needed to purchase Symbolic Math Toolbox to plot 3D explicit functions, but now I am encouraged. Thanks.
Benjamin Backus
2020년 7월 22일
That doesn't look like an ellipsoid to me. The 3rd line should rather be:
z=sqrt(200 - r_sq);
in order to have an ellipsoid of equation x^2 + y^2 + z^2 = 200 (200 because x and y have magnitude 10)
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!