đïž 09082025 1751
đ
svg_basic_curve_commands
Why Curves Matterâ
- Curves make SVG paths powerfulâallowing shapes beyond straight lines, like smooth hills, waves, or organic shapes.
- SVG paths use Bézier curves, just like in CSS animations.
Quadratic BĂ©zier Curve â Q
/ q
â
- Syntax:
Q x1 y1 x y
(x1, y1)
= single control point(x, y)
= end point- Smooth curve with one control point.
- Use relative form
q dx1 dy1 dx dy
for coordinates relative to current position. - Best for gentle, simple curves.
Cubic BĂ©zier Curve â C
/ c
â
- Syntax:
C x1 y1 x2 y2 x y
(x1, y1)
= first control point(x2, y2)
= second control point(x, y)
= end point- More flexible and âcurvyâ than quadratic curves because of two control points.
- Can create complex shapes like pill shapes, loops, or flowing designs.
Quadratic vs. Cubic â When to Useâ
- Rule of thumb:
- Start with quadratic (
Q
) for simpler curves. - If itâs not curvy enough or needs more control â switch to cubic (
C
).
- Start with quadratic (
- Anything possible with
Q
can be done withC
, but not vice versa.
Arcs â A
/ a
**â
- Draw curves as part of a circle or ellipse.
- Useful for shapes and morphing animations.
- Will be discussed in detail later.
â Key Takeaway:
-
Q
= one control point â simpler, gentler curves. -
C
= two control points â more flexibility, more âflowâ. -
Relative forms (
q
,c
) are often easier for adjusting shapes. -
Think of cubic as an extended version of quadratic.