要使用SVG绘制正弦波,请使用以下近似正弦波的一半。我使用三次贝塞尔近似。使用<path>元素。
<!DOCTYPE html> <html> <head> <title>SVG</title> <meta charset = "utf-8" /> </head> <body> <h2 align = "center">HTML5 SVG Sine Waves</h2> <svg width = "150px" height = "200px" viewBox = "0 0 100 100"> <path stroke = "#00FF00" fill = "none" d = "M0,0 C36.42,0,70.58,100,100,100" /> </svg> </body> </html>