【发布时间】:2015-02-19 03:01:20
【问题描述】:
我是 SVG 的初学者。
我需要一条通过点列表的 SVG 曲线。它是一个用 C++ 计算的数学函数,输出结果应该写在 SVG 文件中。我的问题是 SVG 中的 path 标签没有通过所有点。相反,它会在中间跳过其中一些,而只是倾向于它们。 SVG 是否有任何工具可以使曲线通过所有点并以自动方式适当地弯曲曲线?
<svg height="400" width="450">
<path d="M 80 90 C 190 40, 300 60, 380 160" stroke="blue" stroke-width="5" fill="none" />
<path d="M 80 90 L 190 40, 300 60, 380 160" stroke="green" stroke-width="1" fill="none"/>
<g stroke="black" stroke-width="3" fill="black">
<circle id="pointC" cx="80" cy="90" r="3" stroke="black"/>
<circle id="pointA" cx="190" cy="40" r="3" stroke="green"/>
<circle id="pointC" cx="300" cy="60" r="3" stroke="red"/>
<circle id="pointB" cx="380" cy="160" r="3" stroke="blue"/>
</g>
Sorry, your browser does not support inline SVG.
</svg>
【问题讨论】:
标签: math svg curve-fitting