js绘制的漂亮玫瑰曲线rose curve,在数学上 玫瑰 或 罗多纳 曲线 是用极坐标绘制的正弦曲线.基本极性方程是 r = a sin(kθ)
这些曲线是由意大利数学家命名的 Guido Grandi 在1723年到1728年之间,因为它们看起来像玫瑰。
在极坐标系中,以下方程表示的曲线称为玫瑰曲线:
r = sin ( k θ ) 或 r = cos ( k θ )
当 k 是奇数时,玫瑰曲线有 k 个花瓣;当 k 是偶数时,玫瑰曲线有 2k 个花瓣。
可以按 A-Z 和 a-z 调整参数,绘制不同的玫瑰曲线。例如,k = n / d = 2 / 1,就是四叶玫瑰曲线,k = n / d = 3 / 1,就是三叶玫瑰曲线。
以上可以用Matlab等数学软件实现。
下面列举出当k取不同值的时候的曲线图:
鼠标放到不同的曲线上会动态绘制相应的曲线。
在线demo地址:js绘制的漂亮玫瑰曲线rose curve (mubanmao.top)
index.html代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!--<link href="https://fonts.googleapis.com/css?family=Kaushan+Script" rel="stylesheet"> -->
<link href="assets/styles/main.css" rel="stylesheet" />
<title>曲线艺术</title>
</head>
<body>
<header>
<p class="item title">
玫瑰曲线<br/>
<small>
将鼠标移动到曲线上方会自动动态绘制这个曲线
</small>
</p>
<p class="item info">
在数学上 <strong>玫瑰</strong> 或 <strong>罗多纳 曲线</strong> 是用极坐标绘制的正弦曲线.
<br/><em>基本极性方程是 r = a sin(kθ)</em>
</p>
<p class="item info">
这些曲线是由意大利数学家命名的 <strong>Guido Grandi</strong> 在1723年到1728年之间,因为它们看起来像玫瑰
</p>
</header>
<div class="container"></div>
<footer></footer>
<script src="dist/app.js"></script>
</body>
</html>