files/en-us/web/api/path2d/index.md
{{APIRef("Canvas API")}}{{AvailableInWorkers}}
The Path2D interface of the Canvas 2D API is used to declare a path that can then be used on a {{domxref("CanvasRenderingContext2D")}} object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired.
Path2D constructor. Creates a new Path2D object.x, y) coordinates.x, y) coordinates with a straight line.moveTo() before creating the Bézier curve.x, y) position with radius r starting at startAngle and ending at endAngle going in the given direction by counterclockwise (defaulting to clockwise).x, y) position with the radii radiusX and radiusY starting at startAngle and ending at endAngle going in the given direction by counterclockwise (defaulting to clockwise).x, y) with a size that is determined by width and height.x, y) with a size that is determined by width and height and the radii of the circular arc to be used for the corners of the rectangle is determined by radii.{{Specifications}}
{{Compat}}