MATLAB绘制克莱因瓶

MATLAB绘制克莱因瓶

Matlab 复制代码
clc;close all;clear all;warning off;% clear all
rand('seed', 100);
randn('seed', 100);
format long g;


% Parameters
u_range = linspace(0, 2*pi, 100);
v_range = linspace(0, pi, 50);
[U, V] = meshgrid(u_range, v_range);

% Parametric equations for the Klein bottle
x = (3 + cos(U/2).*cos(V) - 0.5*cos(U).*cos(2*V) - sin(U/2).*sin(2*V)).*cos(U);
y = (3 + cos(U/2).*cos(V) - 0.5*cos(U).*cos(2*V) - sin(U/2).*sin(2*V)).*sin(U);
z = 4*sin(U/2).*cos(V);

% Plot the Klein bottle
figure;
surf(x, y, z, 'FaceColor', 'blue', 'EdgeColor', 'none');
hold on;
xlabel('X');
ylabel('Y');
zlabel('Z');
title('Klein Bottle');
grid on;
axis equal;
view(3); % Set the viewing angle
camlight; % Add lighting
lighting phong; % Use phong lighting
hold off;
相关推荐
paterWang2 小时前
基于 Python 和 OpenCV 的酒店客房入侵检测系统设计与实现
开发语言·python·opencv
东方佑2 小时前
使用Python和OpenCV实现图像像素压缩与解压
开发语言·python·opencv
我真不会起名字啊2 小时前
“深入浅出”系列之杂谈篇:(3)Qt5和Qt6该学哪个?
开发语言·qt
laimaxgg2 小时前
Qt常用控件之单选按钮QRadioButton
开发语言·c++·qt·ui·qt5
水瓶丫头站住3 小时前
Qt的QStackedWidget样式设置
开发语言·qt
小钊(求职中)4 小时前
Java开发实习面试笔试题(含答案)
java·开发语言·spring boot·spring·面试·tomcat·maven
慕诗客5 小时前
QT基于Gstreamer采集的简单示例
开发语言·qt
Blasit5 小时前
C++ Qt建立一个HTTP服务器
服务器·开发语言·c++·qt·http
Victoria.a5 小时前
数组和指针常见笔试题(深度剖析)
c语言·开发语言
..过云雨6 小时前
04.类和对象(下)(初始化列表、static静态成员、友元friend[类外函数使用类私有成员]、内部类、匿名对象等)
开发语言·c++