dev4life
dev4life

Reputation: 11394

SVG how to create a bezier curve of 180 degress?

In SVG: 1. is it possible to create a bezier curve of exactly 180 degrees? 2. can bezier curves commands C and Q do what Arc commands can do? 3. is it possible to create half of a circle using only the following commands: M, m, C, c, Q, q?

My experiments so far show that C commands can create arcs but not perferc arcs like an A command would create.

Upvotes: 0

Views: 850

Answers (1)

  1. Exactly? No. The mathematical definition of a Bezier curve means it cannot reproduce a circular arc, no matter how small, perfectly. There's always an error. The first comment to your question links to useful a resource on the issue, http://pomax.github.io/bezierinfo/#circles has an intereactive visual + math explanation.

  2. Based on (1), no. But practically: yes, as long as you use single Bezier curves for small arcs: quadratic curves can only reasonably approximate 1/8th of a full circle before looking wrong, cubic curves can approximate close to 1/3rd before looking wrong. Generally you use a cubic curve for a quarter circle, and then just mirror its coordinates about both axes to get all four sections you need.

  3. Stop asking questions that are ruled out by (1). No, but practically yes; see the links in your comment and this answer =)

Upvotes: 2

Related Questions