《欧拉公式的三维演示(共4页).doc》由会员分享,可在线阅读,更多相关《欧拉公式的三维演示(共4页).doc(4页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上 下面的MATLAB 程序以三维形式演示欧拉公式 Exp(t) = cos(t) + j sin(t)% % 本程序演示欧拉公式% Jan.25th,2012%h_fig1 = figure;set(h_fig1, unit, normalized, position, 0.1, 0.1, 0.9, 0.9);set(h_fig1, defaultuicontrolunits, normalized);h_text1 = uicontrol(h_fig1, Style, text, Position, 0.71, 0.73, 0.25, 0.05,. % 创建文本框
2、String, 是 cos 曲线的起点 , ForegroundColor, r, FontName, 黑体,. FontSize, 12, FontWeight, Bold, BackgroundColor, 1, 1, 1); h_text2 = uicontrol(h_fig1, Style, text, Position, 0.71, 0.78, 0.25, 0.05,. % 创建文本框 String, 是 sin 和 exp 曲线的起点 , ForegroundColor, r, FontName, 黑体,. FontSize, 12, FontWeight, Bold, Backg
3、roundColor, 1, 1, 1); h_pushbutton1 = uicontrol(h_fig1, Style, PushButton, Position, 0.82, 0.12, 0.07, 0.06,. string, 退出, BackgroundColor, 0.8 0.9 0.8, ForegroundColor, r, FontSize, 14, FontWeight, Bold,. callback, delete(h_fig1),) h_axes0 = axes(Box, on, Position, 0.15, 0.18, 0.56, 0.68, FontSize,
4、8) set(gcf,color,w);w = 0.1*pit = 0:40; % 在前进方向绕了 2 圈% a = -ones(1,length(t);plot3(cos(w*t),t,sin(w*t),b, LineWidth, 2);grid on; hold on;hc = plot3(cos(w*t),t,a,k-); hold on;set(hc, Color, r, LineWidth, 2);a=-a;hs = plot3(a,t,sin(w*t),r-.); hold on;set(hs, Color, k, LineWidth, 2);text(0.7,0.3,0.6, -
5、 CCW, FontSize, 14, FontWeight, Bold);text(1,0,-1, Cos, Color, r, FontSize, 14, FontWeight, Bold);text(1,0,0, Sin, FontSize, 14, FontWeight, Bold);% xlabel(x, FontSize, 14, FontWeight, Bold);ylabel(t, FontSize, 14, FontWeight, Bold);zlabel(y, FontSize, 14, FontWeight, Bold);title(演示欧拉公式 y = exp(jwt)
6、 = cos(wt) + jsin(wt), Color, b, FontSize, 18, FontWeight, Bold);% line(-1,-1,39.9,39.9,-1,1,LineWidth,3, Color, r);line(1,1,39.9,39.9,-1,1,LineWidth,3, Color, r);line(-1,-1,0,0,-1,1,LineWidth,3, Color, r);line(1,1,0,0,-1,1,LineWidth,3, Color, r);line(-1,-1,0,40,-1,-1,LineWidth,3, Color, k);line(-1,
7、1,0,0,-1,-1,LineWidth,3, Color, b)line(-1,1,40,40,1,1,LineWidth,3, Color, b)line(-1,1,40,40,-1,-1,LineWidth,3, Color, b)line(-1,1,0,0,1,1,LineWidth,3, Color, b)line(-1,1,0,0,0,0,LineWidth,2, Color, k);line(0,0,0,0,-1,1,LineWidth,2, Color, k);line(0,0,40,40,-1,1,LineWidth,2, Color, k);line(0,0,0,40,0,0,LineWidth,2, Color, k);line(-1,1,40,40,0,0,LineWidth,2, Color, k);line(0,0,0,40,0,0,LineWidth,2, Color, k);text(0,0,0.12,O, FontSize, 14, FontWeight, Bold, Color, r)text(0,40,0.12,O, FontSize, 14, FontWeight, Bold, Color, b)程序运行结果如下所示。按下工具条的Tool | Rotate 3D 选项,用鼠标带动上述的图形,可以任意改变视角。专心-专注-专业