有谁知道如何在MATLAB ...或任何其他编程语言中绘制圆顶(也称为半球形)? [英] Does anyone know how to plot a dome (aka half sphere) in MATLAB...or anyother programming language?

查看:122
本文介绍了有谁知道如何在MATLAB ...或任何其他编程语言中绘制圆顶(也称为半球形)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要绘制一个圆顶或半球形,并且能够更改圆顶的尺寸.我认为MATLAB是我的最佳选择.

I need to plot a dome or half a sphere and be able to change the dimensions of the dome. I figured MATLAB would be my best choice.

有什么建议吗?

谢谢

推荐答案

The SPHERE function generates x, y, and z coordinates for a spherical surface. You just have to remove points corresponding to the bottom of the sphere to make a dome. For example:

[x,y,z] = sphere;      %# Makes a 21-by-21 point sphere
x = x(11:end,:);       %# Keep top 11 x points
y = y(11:end,:);       %# Keep top 11 y points
z = z(11:end,:);       %# Keep top 11 z points
r = 3;                 %# A radius value
surf(r.*x,r.*y,r.*z);  %# Plot the surface
axis equal;            %# Make the scaling on the x, y, and z axes equal

这篇关于有谁知道如何在MATLAB ...或任何其他编程语言中绘制圆顶(也称为半球形)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆