XML technologies / SVG / Using complex graphic elements and formatting / Using paths correctly / Creating Bézier curves / The S command

(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)

The S command draws curves similar to C. However, only one control point needs to be specified here, since both control points share the same position. The syntax is:

S x2 y2 x y

Here, x/y specifies the line’s destination, and x2/y2 the second control point’s position. The first control point is calculated asymmetrically to the second control point of the previous Bézier curve in the path. If there is no previous curve, only the second control point is used. The instruction

<path d="M100 100 S300 250 350 100" style="stroke:rgb(0,0,0);stroke-width:3;fill:none"/>

produces a result such as:

Bézier curve created with the S command

Figure: Bézier curve created with the S command.

Note:
The control point and guide line have again been drawn for illustration.

   

 

 

 

back to top