心形线以及其对心脏的模拟

来源:互联网 发布:红码软件 编辑:程序博客网 时间:2024/04/27 21:54

心形线以及其对心脏的模拟

才疏学浅,难免有误,欢迎批评指正

Clear[a, f, t, y, u]a = 7.5;f[a_, t_] := a (1 + Cos[t]);y = f[a, t];PolarPlot[y, {t, 0, 2 Pi}]

所画出来的图像为:
心形线

Integrate[3/4 Pi a^2, {t, o, 2 Pi}] // N结果:132.536 (6.28319 - 1. o)

则直径7.5cm 的心脏的体积大约为 132.536 cm^3

由心脏线所模拟出来的心脏 3D 图像:

  • 化成 笛卡尔 坐标系的隐式方程作图
ContourPlot3D[ x^2 + y^2 + z^2 - a (x + Sqrt[x^2 + y^2 + z^2]) == 0, {x, -4,   15}, {y, -10, 10}, {z, -13, 13}, Mesh -> None,  ContourStyle -> Directive[Red, Opacity[0.8], Specularity[White, 30]]]

3D图像

貌似有一点太抽象了!!!

下面画一个不抽象的吧!

ContourPlot3D[ 320 ((x^2 + (9 y^2)/4 + z^2 - 1)^3 - x^2 z^3 - (9 y^2 z^3)/80) ==   0, {x, -1.5`, 1.5`}, {y, -1.5`, 1.5`}, {z, -1.5`, 1.5`},  Mesh -> None,  ContourStyle -> Directive[Red, Opacity[0.8], Specularity[White, 30]]]

heart
* (还有其他形式的心形线有待更新!)

使用 mathematica制作

0 0
原创粉丝点击