aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/svg/attribute/d/index.html
blob: 19f60cdac9de61ddd8b7df1e0580b7a1a29fab07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
---
title: d
slug: Web/SVG/Attribute/d
translation_of: Web/SVG/Attribute/d
---
<div>{{SVGRef}}</div>

<p><strong><code>d</code></strong>  속성은 그릴 패스를 정의합니다.</p>

<p>A path definition is a list of <a href="#Path_commands">path commands</a> where each command is composed of a command letter and numbers that represent the command parameters. The commands are detailed below.</p>

<p>Three elements have this attribute: {{SVGElement("path")}}, {{SVGElement("glyph")}}, and {{SVGElement("missing-glyph")}}</p>

<div id="Example">
<div class="hidden">
<pre class="brush: css">html,body,svg { height:100% }</pre>
</div>

<pre class="brush: html">&lt;svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"&gt;
  &lt;path fill="none" stroke="red"
    d="M 10,30
       A 20,20 0,0,1 50,30
       A 20,20 0,0,1 90,30
       Q 90,60 50,90
       Q 10,60 10,30 z" /&gt;
&lt;/svg&gt;</pre>

<p>{{EmbedLiveSample('Example', '100%', 200)}}</p>
</div>

<h2 id="path">path</h2>

<p>For {{SVGElement('path')}}, <code>d</code> is a string containing a series of path commands that define the path to be drawn.</p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="row">Value</th>
   <td><strong><a href="/docs/Web/SVG/Content_type#String">&lt;string&gt;</a></strong></td>
  </tr>
  <tr>
   <th scope="row">Default value</th>
   <td><em>none</em></td>
  </tr>
  <tr>
   <th scope="row">Animatable</th>
   <td>Yes</td>
  </tr>
 </tbody>
</table>

<h2 id="glyph">glyph</h2>

<p class="warning"><strong>Warning:</strong> As of SVG2 {{SVGElement('glyph')}} is deprecated and shouldn't be used.</p>

<p>For {{SVGElement('glyph')}}, <code>d</code> is a string containing a series of path commands that define the outline shape of the glyph.</p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="row">Value</th>
   <td><strong><a href="/docs/Web/SVG/Content_type#String">&lt;string&gt;</a></strong></td>
  </tr>
  <tr>
   <th scope="row">Default value</th>
   <td><em>none</em></td>
  </tr>
  <tr>
   <th scope="row">Animatable</th>
   <td>Yes</td>
  </tr>
 </tbody>
</table>

<p class="note"><strong>Note:</strong> The point of origin (the coordinate <code>0</code>,<code>0</code>) is usually the <em>upper left corner</em> of the context. However the {{SVGElement("glyph")}} element has its origin in the <em>bottom left corner</em> of its letterbox.</p>

<h2 id="missing-glyph">missing-glyph</h2>

<p class="warning"><strong>Warning:</strong> As of SVG2 {{SVGElement('missing-glyph')}} is deprecated and shouldn't be used.</p>

<p>For {{SVGElement('missing-glyph')}}, <code>d</code> is a string containing a series of path commands that define the outline shape of the glyph.</p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="row">Value</th>
   <td><strong><a href="/docs/Web/SVG/Content_type#String">&lt;string&gt;</a></strong></td>
  </tr>
  <tr>
   <th scope="row">Default value</th>
   <td><em>none</em></td>
  </tr>
  <tr>
   <th scope="row">Animatable</th>
   <td>Yes</td>
  </tr>
 </tbody>
</table>

<h2 id="Path_commands">Path commands</h2>

<p>Path commands are instructions that define a path to be drawn. Each command is composed of a command letter and numbers that represent the command parameters.</p>

<p>SVG defines 6 types of path commands, for a total of 20 commands:</p>

<ul>
 <li>MoveTo: <code>M</code>, <code>m</code></li>
 <li>LineTo: <code>L</code>, <code>l</code>, <code>H</code>, <code>h</code>, <code>V</code>, <code>v</code></li>
 <li>Cubic Bézier Curve: <code>C</code>, <code>c</code>, <code>S</code>, <code>s</code></li>
 <li>Quadratic Bézier Curve: <code>Q</code>, <code>q</code>, <code>T</code>, <code>t</code></li>
 <li>Elliptical Arc Curve: <code>A</code>, <code>a</code></li>
 <li>ClosePath: <code>Z</code>, <code>z</code></li>
</ul>

<p class="note"><strong>Note:</strong> Commands are case-sensitive; an upper-case command specifies its arguments as absolute positions, while a lower-case command specifies points relative to the current position.</p>

<p>It is always possible to specify a negative value as an argument to a command: negative angles will be anti-clockwise; absolute x and y positions will be taken as negative coordinates; negative relative x values will move to the left; and negative relative y values will move upwards.</p>

<h3 id="MoveTo_path_commands">MoveTo path commands</h3>

<p><em>MoveTo</em> instructions can be thought of as picking up the drawing instrument, and setting it down somewhere else, i.e. moving the <em>current point</em> (P<sub>o</sub>; {x<sub>o</sub>, y<sub>o</sub>}). There is no line drawn between P<sub>o </sub>and the new <em>current point</em> (P<sub>n</sub>; {x<sub>n</sub>, y<sub>n</sub>}).</p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Command</th>
   <th scope="col">Parameters</th>
   <th scope="col">Notes</th>
  </tr>
  <tr>
   <th scope="row">M</th>
   <td>(<code>x</code>, <code>y</code>)+</td>
   <td>Move the <em>current point</em> to the coordinate <code>x</code>,<code>y</code>. Any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit absolute LineTo (<code>L</code>) command(s) (<em>see below</em>). Formula: P<sub>n</sub> = {<code>x</code>, <code>y</code>}</td>
  </tr>
  <tr>
   <th scope="row">m</th>
   <td>(<code>dx</code>, <code>dy</code>)+</td>
   <td>Move the <em>current point</em> by shifting the last known position of the path by <code>dx</code> along the x-axis and by <code>dy</code> along the y-axis. Any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit relative LineTo (<code>l</code>) command(s) (<em>see below</em>). Formula: P<sub>n</sub> = {x<sub>o</sub> + <code>dx</code>, y<sub>o</sub> + <code>dy</code>}</td>
  </tr>
 </tbody>
</table>

<h4 id="Examples">Examples</h4>

<div class="hidden">
<pre class="brush: css">html,body,svg { height:100% }</pre>
</div>

<pre class="brush: html">&lt;svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"&gt;
  &lt;path fill="none" stroke="red"
    d="M 10,10 h 10
       m  0,10 h 10
       m  0,10 h 10
       M 40,20 h 10
       m  0,10 h 10
       m  0,10 h 10
       m  0,10 h 10
       M 50,50 h 10
       m-20,10 h 10
       m-20,10 h 10
       m-20,10 h 10" /&gt;
&lt;/svg&gt;</pre>

<p>{{EmbedLiveSample('MoveTo_path_commands', '100%', 200)}}</p>

<h3 id="LineTo_path_commands">LineTo path commands</h3>

<p><em>LineTo</em> instructions draw a straight line from the <em>current point</em> (P<sub>o</sub>; {x<sub>o</sub>, y<sub>o</sub>}) to the <em>end point</em> (P<sub>n</sub>; {x<sub>n</sub>, y<sub>n</sub>}), based on the parameters specified. The <em>end point </em>(P<sub>n</sub>) then becomes the <em>current point </em>for the next command (P<sub>o</sub><sup>'</sup>).</p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Command</th>
   <th scope="col">Parameters</th>
   <th scope="col">Notes</th>
  </tr>
  <tr>
   <th scope="row">L</th>
   <td>(<code>x</code>, <code>y</code>)+</td>
   <td>Draw a line from the <em>current point </em>to the <em>end point</em> specified by <code>x</code>,<code>y</code>. Any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit absolute LineTo (<code>L</code>) command(s). Formula: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {<code>x</code>, <code>y</code>}</td>
  </tr>
  <tr>
   <th scope="row">l</th>
   <td>(<code>dx</code>, <code>dy</code>)+</td>
   <td>Draw a line from the <em>current point </em>to the <em>end point,</em> which is the <em>current point</em> shifted by <code>dx</code> along the x-axis and <code>dy</code> along the y-axis. Any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit relative LineTo (<code>l</code>) command(s) (<em>see below</em>). Formula: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {x<sub>o</sub> + <code>dx</code>, y<sub>o</sub> + <code>dy</code>}</td>
  </tr>
  <tr>
   <th scope="row">H</th>
   <td><code>x</code>+</td>
   <td>Draw a horizontal line from the <em>current point </em>to the <em>end point</em>, which is specified by the <code>x</code> parameter and the <em>current point's</em> y coordinate. Any subsequent value(s) are interpreted as parameter(s) for implicit absolute horizontal LineTo (<code>H</code>) command(s). Formula: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {<code>x</code>, y<sub>o</sub>}</td>
  </tr>
  <tr>
   <th scope="row">h</th>
   <td><code>dx</code>+</td>
   <td>Draw a horizontal line from the <em>current point </em>to the <em>end point,</em> which is specified by the <em>current point</em> shifted by <code>dx</code> along the x-axis and the <em>current point's</em> y coordinate. Any subsequent value(s) are interpreted as parameter(s) for implicit relative horizontal LineTo (<code>h</code>) command(s). Formula: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {x<sub>o</sub> + <code>dx</code>, y<sub>o</sub>}</td>
  </tr>
  <tr>
   <th scope="row">V</th>
   <td><code>y</code>+</td>
   <td>Draw a vertical line from the <em>current point </em>to the <em>end point</em>, which is specified by the <code>y</code> parameter and the <em>current point's</em> x coordinate. Any subsequent values are interpreted as parameters for implicit absolute vertical LineTo (<code>V</code>) command(s). Formula: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {x<sub>o</sub>, <code>y</code>}</td>
  </tr>
  <tr>
   <th scope="row">v</th>
   <td><code>dy</code>+</td>
   <td>Draw a vertical line from the <em>current point </em>to the <em>end point,</em> which is specified by the <em>current point</em> shifted by <code>dy</code> along the y-axis and the <em>current point's</em> x coordinate. Any subsequent value(s) are interpreted as parameter(s) for implicit relative vertical LineTo (<code>v</code>) command(s). Formula: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {x<sub>o, </sub>y<sub>o</sub> + <code>dy</code>}</td>
  </tr>
 </tbody>
</table>

<h4 id="Examples_2">Examples</h4>

<div class="hidden">
<pre class="brush: css">html,body,svg { height:100% }</pre>
</div>

<pre class="brush: html">&lt;svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"&gt;
  &lt;!-- LineTo commands with absolute coordinates --&gt;
  &lt;path fill="none" stroke="red"
        d="M 10,10
           L 90,90
           V 10
           H 50" /&gt;

  &lt;!-- LineTo commands with relative coordinates --&gt;
  &lt;path fill="none" stroke="red"
        d="M 110,10
           l 80,80
           v -80
           h -40" /&gt;
&lt;/svg&gt;</pre>

<p>{{EmbedLiveSample('LineTo_path_commands', '100%', 200)}}</p>

<h3 id="Cubic_Bézier_Curve">Cubic Bézier Curve</h3>

<p><em>Cubic <a href="https://en.wikipedia.org/wiki/Bézier_curve">Bézier curves</a></em> are smooth curve definitions using four points:</p>

<ul>
 <li><em>starting point (current point)</em> (P<sub>o</sub> = {x<sub>o</sub>, y<sub>o</sub>})</li>
 <li><em>end point </em>(P<sub>n</sub> = {x<sub>n</sub>, y<sub>n</sub>})</li>
 <li><em>start control point </em> (P<sub>cs</sub> = {x<sub>cs</sub>, y<sub>cs</sub>}) (controls curvature near the start of the curve)</li>
 <li><em>end control point </em>(P<sub>ce</sub> = {x<sub>ce</sub>, y<sub>ce</sub>}) (controls curvature near the end of the curve).</li>
</ul>

<p>After drawing, the <em>end point </em>(P<sub>n</sub>) becomes the <em>current point </em>for the next command (P<sub>o</sub>').</p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Command</th>
   <th scope="col">Parameters</th>
   <th scope="col">Notes</th>
  </tr>
  <tr>
   <th scope="row">C</th>
   <td>(<code>x1</code>,<code>y1</code>, <code>x2</code>,<code>y2</code>, <code>x</code>,<code>y</code>)+</td>
   <td>Draw a cubic Bézier curve from the <em>current point </em>to the <em>end point </em>specified by <code>x</code>,<code>y</code>. The <em>start control point</em> is specified by <code>x1</code>,<code>y1</code> and the <em>end control point </em>is specified by <code>x2</code>,<code>y2</code><em>.</em> Any subsequent triplet(s) of coordinate pairs are interpreted as parameter(s) for implicit absolute cubic Bézier curve (<code>C</code>) command(s). Formulae: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {<code>x</code>, <code>y</code>} ; P<sub>cs</sub> = {<code>x1</code>, <code>y1</code>} ; P<sub>ce</sub> = {<code>x2</code>, <code>y2</code>}</td>
  </tr>
  <tr>
   <th scope="row">c</th>
   <td>(<code>dx1</code>,<code>dy1</code>, <code>dx2</code>,<code>dy2</code>, <code>dx</code>,<code>dy</code>)+</td>
   <td>Draw a cubic Bézier curve from the <em>current point </em>to the <em>end point,</em> which is the <em>current point</em> shifted by <code>dx</code> along the x-axis and <code>dy</code> along the y-axis. The <em>start control point </em>is the <em>current point</em> (starting point of the curve) shifted by <code>dx1</code> along the x-axis and <code>dy1</code> along the y-axis. The <em>end control point </em>is the <em>current point</em> (starting point of the curve) shifted by <code>dx2</code> along the x-axis and <code>dy2</code> along the y-axis. Any subsequent triplet(s) of coordinate pairs are interpreted as parameter(s) for implicit relative cubic Bézier curve (<code>c</code>) command(s). Formulae: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {x<sub>o</sub> + <code>dx</code>, y<sub>o</sub> + <code>dy</code>} ; P<sub>cs</sub> = {x<sub>o</sub> + <code>dx1</code>, y<sub>o</sub> + <code>dy1</code>} ; P<sub>ce</sub> = {x<sub>o</sub> + <code>dx2</code>, y<sub>o</sub> + <code>dy2</code>}</td>
  </tr>
  <tr>
   <th scope="row">S</th>
   <td>(<code>x2</code>,<code>y2</code>, <code>x</code>,<code>y</code>)+</td>
   <td>Draw a smooth cubic Bézier curve from the <em>current point </em>to the <em>end point</em> specified by <code>x</code>,<code>y</code>. The <em>end control point</em> is specified by <code>x2</code>,<code>y2</code>. The <em>start control point</em> is a reflection of the <em>end control point</em> of the previous curve command. If the previous command wasn't a curve, the <em>start control point </em>is the same as the curve starting point (<em>current point</em>). Any subsequent pair(s) of coordinate pairs are interpreted as parameter(s) for implicit absolute smooth cubic Bézier curve (<code>S</code>) commands.</td>
  </tr>
  <tr>
   <th scope="row">s</th>
   <td>(<code>dx2</code>,<code>dy2</code>, <code>dx</code>,<code>dy</code>)+</td>
   <td>Draw a smooth cubic Bézier curve from the <em>current point </em>to the <em>end point</em>, which is the <em>current point </em>shifted by <code>dx</code> along the x-axis and <code>dy</code> along the y-axis. The <em>end control point</em> is the <em>current point</em> (starting point of the curve) shifted by <code>dx2</code> along the x-axis and <code>dy2</code> along the y-axis. The <em>start control point</em> is a reflection of the <em>end control point</em> of the previous curve command. If the previous command wasn't a curve, the <em>start control point </em>is the same as the curve starting point (<em>current point</em>). Any subsequent pair(s) of coordinate pairs are interpreted as parameter(s) for implicit relative smooth cubic Bézier curve (<code>s</code>) commands.</td>
  </tr>
 </tbody>
</table>

<h4 id="Examples_3">Examples</h4>

<div class="hidden">
<pre class="brush: css">html,body,svg { height:100% }</pre>
</div>

<pre class="brush: html">&lt;svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;

  &lt;!-- Cubic Bézier curve with absolute coordinates --&gt;
  &lt;path fill="none" stroke="red"
        d="M 10,90
           C 30,90 25,10 50,10
           S 70,90 90,90" /&gt;

  &lt;!-- Cubic Bézier curve with relative coordinates --&gt;
  &lt;path fill="none" stroke="red"
        d="M 110,90
           c 20,0 15,-80 40,-80
           s 20,80 40,80" /&gt;

  &lt;!-- Highlight the curve vertex and control points --&gt;
  &lt;g id="ControlPoints"&gt;

    &lt;!-- First cubic command control points --&gt;
    &lt;line x1="10" y1="90" x2="30" y2="90" stroke="lightgrey" /&gt;
    &lt;circle cx="30" cy="90" r="1.5"/&gt;

    &lt;line x1="50" y1="10" x2="25" y2="10" stroke="lightgrey" /&gt;
    &lt;circle cx="25" cy="10" r="1.5"/&gt;

    &lt;!-- Second smooth command control points (the first one is implicit) --&gt;
    &lt;line x1="50" y1="10" x2="75" y2="10" stroke="lightgrey" stroke-dasharray="2" /&gt;
    &lt;circle cx="75" cy="10" r="1.5" fill="lightgrey"/&gt;

    &lt;line x1="90" y1="90" x2="70" y2="90" stroke="lightgrey" /&gt;
    &lt;circle cx="70" cy="90" r="1.5" /&gt;

    &lt;!-- curve vertex points --&gt;
    &lt;circle cx="10" cy="90" r="1.5"/&gt;
    &lt;circle cx="50" cy="10" r="1.5"/&gt;
    &lt;circle cx="90" cy="90" r="1.5"/&gt;
  &lt;/g&gt;
  &lt;use xlink:href="#ControlPoints" x="100" /&gt;
&lt;/svg&gt;</pre>

<p>{{EmbedLiveSample('Cubic_Bézier_Curve', '100%', 200)}}</p>

<h3 id="Quadratic_Bézier_Curve">Quadratic Bézier Curve</h3>

<p><em>Quadratic <a href="https://en.wikipedia.org/wiki/Bézier_curve">Bézier curves</a></em> are smooth curve definitions using three points:</p>

<ul>
 <li><em>starting point (current point)</em> (P<sub>o</sub> = {x<sub>o</sub>, y<sub>o</sub>})</li>
 <li><em>end point </em>(P<sub>n</sub> = {x<sub>n</sub>, y<sub>n</sub>})</li>
 <li><em>control point </em> (P<sub>c</sub> = {x<sub>c</sub>, y<sub>c</sub>}) (controls curvature)</li>
</ul>

<p> </p>

<p>After drawing, the <em>end point </em>(P<sub>n</sub>) becomes the <em>current point </em>for the next command (P<sub>o</sub>').</p>

<p> </p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Command</th>
   <th scope="col">Parameters</th>
   <th scope="col">Notes</th>
  </tr>
  <tr>
   <th scope="row">Q</th>
   <td>(<code>x1</code>,<code>y1</code>, <code>x</code>,<code>y</code>)+</td>
   <td>Draw a quadratic Bézier curve from the <em>current point </em>to the <em>end point </em>specified by <code>x</code>,<code>y</code>. The <em>control point</em> is specified by <code>x1</code>,<code>y1</code>. Any subsequent pair(s) of coordinate pairs are interpreted as parameter(s) for implicit absolute quadratic Bézier curve (<code>Q</code>) command(s). Formulae: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {<code>x</code>, <code>y</code>} ; P<sub>c</sub> = {<code>x1</code>, <code>y1</code>}</td>
  </tr>
  <tr>
   <th scope="row">q</th>
   <td>(<code>dx1</code>,<code>dy1</code>, <code>dx</code>,<code>dy</code>)+</td>
   <td>Draw a quadratic Bézier curve from the <em>current point </em>to the <em>end point</em>, which is the <em>current point </em>shifted by <code>dx</code> along the x-axis and <code>dy</code> along the y-axis. The <em>control point </em>is the <em>current point</em> (starting point of the curve) shifted by <code>dx1</code> along the x-axis and <code>dy1</code> along the y-axis. Any subsequent pair(s) of coordinate pairs are interpreted as parameter(s) for implicit relative quadratic Bézier curve (<code>q</code>) command(s). Formulae: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {x<sub>o</sub> + <code>dx</code>, y<sub>o</sub> + <code>dy</code>} ; P<sub>c</sub> = {x<sub>o</sub> + <code>dx1</code>, y<sub>o</sub> + <code>dy1</code>}</td>
  </tr>
  <tr>
   <th scope="row">T</th>
   <td>(<code>x</code>,<code>y</code>)+</td>
   <td>Draw a smooth quadratic Bézier curve from the <em>current point </em>to the <em>end point </em>specified by <code>x</code>,<code>y</code>. The <em>control point</em> is a reflection of the <em>control point</em> of the previous curve command. If the previous command wasn't a curve, the <em>control point </em>is the same as the curve starting point (<em>current point</em>). Any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit absolute smooth quadratic Bézier curve (<code>T</code>) command(s). Formula: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {<code>x</code>, <code>y</code>}</td>
  </tr>
  <tr>
   <th scope="row">t</th>
   <td>(<code>dx</code>,<code>dy</code>)+</td>
   <td>Draw a smooth quadratic Bézier curve from the <em>current point </em>to the <em>end point</em>, which is the <em>current point </em>shifted by <code>dx</code> along the x-axis and <code>dy</code> along the y-axis. The <em>control point </em>is a reflection of the <em>control point </em>of the previous curve command. If the previous command wasn't a curve, the <em>control point </em>is the same as the curve starting point (<em>current point</em>). Any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit relative smooth quadratic Bézier curve (<code>t</code>) command(s). Formulae: P<sub>o</sub><sup>'</sup> = P<sub>n</sub> = {x<sub>o</sub> + <code>dx</code>, y<sub>o</sub> + <code>dy</code>}</td>
  </tr>
 </tbody>
</table>

<h4 id="Examples_4">Examples</h4>

<div class="hidden">
<pre class="brush: css">html,body,svg { height:100% }</pre>
</div>

<pre class="brush: html">&lt;svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;

  &lt;!-- Quadratic Bézier curve with implicite repetition --&gt;
  &lt;path fill="none" stroke="red"
        d="M 10,50
           Q 25,25 40,50
           t 30,0 30,0 30,0 30,0 30,0" /&gt;

  &lt;!-- Highlight the curve vertex and control points --&gt;
  &lt;g&gt;
    &lt;polyline points="10,50 25,25 40,50" stroke="rgba(0,0,0,.2)" fill="none" /&gt;
    &lt;circle cx="25" cy="25" r="1.5" /&gt;

    &lt;!-- curve vertex points --&gt;
    &lt;circle cx="10" cy="50" r="1.5"/&gt;
    &lt;circle cx="40" cy="50" r="1.5"/&gt;

    &lt;g id="SmoothQuadraticDown"&gt;
      &lt;polyline points="40,50 55,75 70,50" stroke="rgba(0,0,0,.2)" stroke-dasharray="2" fill="none" /&gt;
      &lt;circle cx="55" cy="75" r="1.5" fill="lightgrey" /&gt;
      &lt;circle cx="70" cy="50" r="1.5" /&gt;
    &lt;/g&gt;

    &lt;g id="SmoothQuadraticUp"&gt;
      &lt;polyline points="70,50 85,25 100,50" stroke="rgba(0,0,0,.2)" stroke-dasharray="2" fill="none" /&gt;
      &lt;circle cx="85" cy="25" r="1.5" fill="lightgrey" /&gt;
      &lt;circle cx="100" cy="50" r="1.5" /&gt;
    &lt;/g&gt;

    &lt;use xlink:href="#SmoothQuadraticDown" x="60" /&gt;
    &lt;use xlink:href="#SmoothQuadraticUp"   x="60" /&gt;
    &lt;use xlink:href="#SmoothQuadraticDown" x="120" /&gt;
  &lt;/g&gt;
&lt;/svg&gt;</pre>

<p>{{EmbedLiveSample('Quadratic_Bézier_Curve', '100%', 200)}}</p>

<h3 id="Elliptical_Arc_Curve">Elliptical Arc Curve</h3>

<p><em>Elliptical arc curves</em> are curves define as a portion of an ellipse. It is sometimes easier than Bézier curve to draw highly regular curves.</p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Command</th>
   <th scope="col">Parameters</th>
   <th scope="col">Notes</th>
  </tr>
  <tr>
   <th scope="row">A</th>
   <td>(<code>rx</code> <code>ry</code> <code>angle</code> <code>large-arc-flag</code> <code>sweep-flag</code> <code>x</code> <code>y</code>)+</td>
   <td>
    <p>Draw an Arc curve from the current point to the coordinate <code>x</code>,<code>y</code>. The center of the ellipse used to draw the arc is determine automatically based on the other parameters of the command:</p>

    <ul>
     <li><code>rx</code> and <code>ry</code> are the two radii of the ellipse;</li>
     <li><code>angle</code> represents a rotation (in degree) of the ellipse relative to the x-axis;</li>
     <li><code>large-arc-flag</code> and <code>sweep-flag</code> allows to chose which arc must be drawn as 4 possible arcs can be drawn out of the other parameters.
      <ul>
       <li><code>large-arc-flag</code> allows to chose one of the large arc (<strong>1</strong>) or small arc (<strong>0</strong>),</li>
       <li><code>sweep-flag</code> allows to chose one of the clockwise turning arc (<strong>1</strong>) or anticlockwise turning arc (<strong>0</strong>)</li>
      </ul>
     </li>
    </ul>
    The coordinate <code>x</code>,<code>y</code> become the new current point for the next command. All subsequent sets of parameters are considered implicit absolute arc curve (<code>A</code>) commands.</td>
  </tr>
  <tr>
   <th scope="row">a</th>
   <td>(<code>rx</code> <code>ry</code> <code>angle</code> <code>large-arc-flag</code> <code>sweep-flag</code> <code>dx</code> <code>dy</code>)+</td>
   <td>
    <p>Draw an Arc curve from the current point to to a point for which coordinates are those of the current point shifted by <code>dx</code> along the x-axis and <code>dy</code> along the y-axis. The center of the ellipse used to draw the arc is determine automatically based on the other parameters of the command:</p>

    <ul>
     <li><code>rx</code> and <code>ry</code> are the two radii of the ellipse;</li>
     <li><code>angle</code> represents a rotation (in degree) of the ellipse relative to the x-axis;</li>
     <li><code>large-arc-flag</code> and <code>sweep-flag</code> allows to chose which arc must be drawn as 4 possible arcs can be drawn out of the other parameters.
      <ul>
       <li><code>large-arc-flag</code> allows to chose one of the large arc (<strong>1</strong>) or small arc (<strong>0</strong>),</li>
       <li><code>sweep-flag</code> allows to chose one of the clockwise turning arc (<strong>1</strong>) or anticlockwise turning arc (<strong>0</strong>)</li>
      </ul>
     </li>
    </ul>
    The current point gets its X and Y coordinates shifted by <code>dx</code> and <code>dy</code> for the next command. All subsequent sets of parameters are considered implicit relative arc curve (<code>a</code>) commands.</td>
  </tr>
 </tbody>
</table>

<h4 id="Examples_5">Examples</h4>

<div class="hidden">
<pre class="brush: css">html,body,svg { height:100% }</pre>
</div>

<pre class="brush: html">&lt;svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"&gt;

  &lt;!-- The influence of the arc flags on which arc is drawn --&gt;
  &lt;path fill="none" stroke="red"
        d="M 6,10
           A 6 4 10 1 0 14,10" /&gt;

  &lt;path fill="none" stroke="lime"
        d="M 6,10
           A 6 4 10 1 1 14,10" /&gt;

  &lt;path fill="none" stroke="purple"
        d="M 6,10
           A 6 4 10 0 1 14,10" /&gt;

  &lt;path fill="none" stroke="pink"
        d="M 6,10
           A 6 4 10 0 0 14,10" /&gt;
&lt;/svg&gt;</pre>

<p>{{EmbedLiveSample('Elliptical_Arc_Curve', '100%', 200)}}</p>

<h3 id="ClosePath">ClosePath</h3>

<p><em>ClosePath</em> instructions draw a straight line from the current position, to the first point in the path.</p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Command</th>
   <th scope="col">Parameters</th>
   <th scope="col">Notes</th>
  </tr>
  <tr>
   <th scope="row">Z, z</th>
   <td> </td>
   <td>Close the current subpath by connecting the last point of the path with its initial point. If the two points doesn't have the same coordinates, a straight line is drawn between those two points.</td>
  </tr>
 </tbody>
</table>

<p class="note"><strong>Note:</strong> The appearance of a shape closed with closepath may be different to that of one closed by drawing a line to the origin, using one of the other commands, because the line ends are joined together (according to the {{SVGAttr('stroke-linejoin')}} setting), rather than just being placed at the same coordinates.</p>

<h4 id="Examples_6">Examples</h4>

<div class="hidden">
<pre class="brush: css">html,body,svg { height:100% }</pre>
</div>

<pre class="brush: html">&lt;svg viewBox="0 -1 30 11" xmlns="http://www.w3.org/2000/svg"&gt;

  &lt;!--
  An open shape with the last point of
  the path different than the first one
  --&gt;
  &lt;path stroke="red"
        d="M 5,1
           l -4,8 8,0" /&gt;

  &lt;!--
  An open shape with the last point of
  the path matching the first one
  --&gt;
  &lt;path stroke="red"
        d="M 15,1
           l -4,8 8,0 -4,-8" /&gt;

  &lt;!--
  An closed shape with the last point of
  the path different than the first one
  --&gt;
  &lt;path stroke="red"
        d="M 25,1
           l -4,8 8,0
           z" /&gt;
&lt;/svg&gt;</pre>

<p>{{EmbedLiveSample('ClosePath', '100%', 200)}}</p>

<h2 id="Specification">Specification</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName("SVG2", "paths.html#DProperty", "d")}}</td>
   <td>{{Spec2("SVG2")}}</td>
   <td>Definition for <code>&lt;path&gt;</code></td>
  </tr>
  <tr>
   <td>{{SpecName("SVG1.1", "fonts.html#GlyphElementDAttribute", "d")}}</td>
   <td>{{Spec2("SVG1.1")}}</td>
   <td>Initial definition for <code>&lt;glyph&gt;</code> and <code>&lt;missing-glyph&gt;</code></td>
  </tr>
  <tr>
   <td>{{SpecName("SVG1.1", "paths.html#DAttribute", "d")}}</td>
   <td>{{Spec2("SVG1.1")}}</td>
   <td>Initial definition for <code>&lt;path&gt;</code></td>
  </tr>
 </tbody>
</table>