通过二阶贝塞尔曲线的抛物线效果来绘制正弦波
drawCoordinateSystem(canvas)
//保存之前Canvas的状态,save之后可以调用Canvas的平移、旋转等操作
canvas.save()
canvas.translate(measuredWidth / 2f, measuredHeight / 2f)
mPaint.color = Color.parseColor("black")
mPaint.style = Paint.Style.STROKE
mPath.rewind()
val l = 500f
mPath.moveTo(-l, 0f)
mPath.rQuadTo(l / 2, -l, l, 0f)
mPath.rQuadTo(l / 2, l, l, 0f)
canvas.drawPath(mPath, mPaint)
//与 save() 成对出现,恢复之前保存的canvas状态,防止上述save之后的canvas操作对后续的绘制产生影响
canvas.restore()//