我有此產生的曲線,:如何在SVG/raphael的貝塞爾曲線的末端繪製箭頭?
var path = ["M", x1.toFixed(3), y1.toFixed(3), "L", arrow_left_x, arrow_left_y, "L", arrow_right_x, arrow_right_y, "L", x1.toFixed(3), y1.toFixed(3), "C", x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)].join(",");
,但我的箭不正確。
- 它只指向右側,並不指向與貝塞爾曲線末端的曲線斜率相同的方向。 - 它沒有填充
現在,我知道我沒有在這裏正確地做數學,但主要是,我只是想知道如何填補行結束的三角形。謝謝!
爲了演示:
arrow_left_x = (x1 - 8);
arrow_left_y = (y1 - 8);
arrow_right_x = (x1 - 8);
arrow_right_y = (y1 + 8);
是用於獲取我用座標的代碼。
參見_ [我的SVG線箭頭的三角形(http://stackoverflow.com/questions/11808860/arrow-triangles-on-my-svg-line)_。 – Phrogz
現在Raphael 2.1有一個路徑attr對,這個'arrow-start'和'arrow-end',見https://stackoverflow.com/questions/27372513/raphaeljs-how-to-draw-arrow-heads-at不能解決箭頭問題的角度的拱結構 – user568458