How can I calculate the area of a bezier curve?

前端 未结 6 1628
孤独总比滥情好
孤独总比滥情好 2020-12-08 10:49

Given the following path (for example) which describes a SVG cubic bezier curve: \"M300,140C300,40,500,40,500,140\", and assuming a straight line connecting the end points 3

6条回答
  •  -上瘾入骨i
    2020-12-08 11:31

    Firstly, I am not so familier with bezier curves, but I know that they are continuous functions. If you ensure that your cubic curve does not intersect itself, you may integrate it in closed form (I mean by using analytic integrals) on the given enclosing domain ([a-b]) and subtract the area of triangle that is formed by the the end joining straight line and X axis. In case of intersection with the Bezier curve and end joining straight line, you may divide into sections and try to calculate each area separately in a consistent manner..

    For me suitable search terms are "continuous function integration" "integrals" "area under a function" "calculus"

    OF course you may generate discrete data from your bezier curve fn and obtain discrete X-Y data and calculate the integral approximately.

    Descriptive drawing

提交回复
热议问题