Mathematica 编程实战(2)
Mathematica 编程实战(2)
type
status
date
slug
summary
tags
category
icon
password
Property
Jan 10, 2023 07:42 AM
URL

1. 一般旋转曲面

1.1 一般的数学定义

如图所示,我们说
  • 绕轴旋轴的曲线称作 母线
  • 中间这个轴叫做 旋旋轴
notion image
母线绕轴旋转一周会得到一个旋转曲面,类似于下面这样的图.
notion image
 

1.2 数学求解

我们知道空间直角坐标系中 曲线 是由于 面和面 相交得到的
notion image
所以我们可以用连立两个曲面的方程,就能得到曲线的表达式了,如下
这个旋转轴无法就是一个直线,我们同样可以定义一个一般直线:
 
notion image
  • 这里的 是曲线上的任意一点,曲线从这个点开始绕旋转轴旋转.
  • 这里 是直线点法式的初始点, 是直线的向量
  • 我们要求曲面的方程实际上就是从曲面上任意找一点 然后建立方程求解即可
从图中我们可以看到两个条件
( 1 )
( 2 )
基于这两点我们就能建立两个方程:
然后再和
连立,消去 就能得到我们想要的了

2. 编程实现

2.1 总代码

(* y,z与x的关系 *) y = -0.024 x^2 + 1.75 x + 220.15; z = -0.022 x^2 - 4.78 x + 713.41; (* 直线的方向向量 *) s = {1, 3.248, -3.244}; (* 直线的方程 *) line = {x, 3.248 x + 15.668, -3.224 x + 521.8}; (* 旋转变化 *) func = RotationTransform[\[Theta], s, line /. x -> 0]; (* 直线的绘制 *) linePlot = Graphics3D[ {Red, PointSize[0.025], Point[line /. x -> 0], Blue, Thickness[0.01], InfiniteLine[line /. x -> 0, s]}]; (* 空间坐标系的箭头 *) arrowAxes[arrowLength_] := Map[{Black, Arrow[Tube[{{0, 0, 0}, #}]]} &, arrowLength IdentityMatrix[3]]; arrowAxesPlot = Graphics3D[{arrowAxes[1100]}, Axes -> True, Boxed -> False, AxesLabel -> {"x", "y", "z"}, AxesOrigin -> {0, 0, 0}, AxesStyle -> Opacity[0], TicksStyle -> Opacity[1], BaseStyle -> {FontFamily -> "Times New Roman", FontSize -> 15, Italic} ]; Manipulate[ Show[ arrowAxesPlot, ParametricPlot3D[{func@{x, y, z}} // Evaluate, {x, -100, 100}, {\[Theta], -theta, theta}, Axes -> False, AxesOrigin -> {0, 0, 0}, AxesStyle -> Arrowheads[{0, 2}], PlotRange -> {{-1000, 1000}, All, All}, PlotStyle -> {Green, Opacity@0.2}, Boxed -> False] , linePlot], {theta, 0.01, Pi}]
notion image

2.2 代码的剖析

 
Ubuntu 20.04 安装 orca 5.03关于杂环化合物的命名