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;
相关推荐
無限進步D1 小时前
Java 运行原理
java·开发语言·入门
是苏浙1 小时前
JDK17新增特性
java·开发语言
阿里加多4 小时前
第 4 章:Go 线程模型——GMP 深度解析
java·开发语言·后端·golang
likerhood5 小时前
java中`==`和`.equals()`区别
java·开发语言·python
zs宝来了5 小时前
AQS详解
java·开发语言·jvm
telllong6 小时前
Python异步编程从入门到不懵:asyncio实战踩坑7连发
开发语言·python
wjs20248 小时前
JavaScript 条件语句
开发语言
阿里加多8 小时前
第 1 章:Go 并发编程概述
java·开发语言·数据库·spring·golang
2301_792674868 小时前
java学习day29(juc)
java·开发语言·学习
周末也要写八哥8 小时前
MATLAB R2025a超详细下载与安装教程(附安装包)
开发语言·matlab