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;
相关推荐
551只玄猫8 小时前
【数学建模 matlab 实验报告1】
开发语言·数学建模·matlab·课程设计·实验报告
三道渊9 小时前
C语言:文件I/O
c语言·开发语言·数据结构·c++
hnlgzb9 小时前
安卓app kotlin语法,Hilt是什么东西?
android·开发语言·kotlin
没用的阿_吉10 小时前
windows10 Qt5.15.14 msvc2019 编译部署
开发语言·qt
聊聊MES那点事10 小时前
JavaScript图表控件AG Charts使用教程:使用AG Charts React实时更新柱状图
开发语言·javascript·react.js·图表控件
ywf121510 小时前
Go基础之环境搭建
开发语言·后端·golang
biubiubiu070610 小时前
Python 环境安装与 Linux 控制入门
linux·开发语言·python
是有头发的程序猿10 小时前
用Open Claw接口做1688选品、价格监控、货源对比
开发语言·c++·人工智能
斯班奇的好朋友阿法法11 小时前
离线ollama导入Qwen3.5-9B.Q8_0.gguf模型
开发语言·前端·javascript
计算机安禾11 小时前
【数据结构与算法】第19篇:树与二叉树的基础概念
c语言·开发语言·数据结构·c++·算法·visual studio code·visual studio