Drawing a semi – circle on a Canvas may seem like a simple task, but it involves a good understanding of the Canvas API and basic geometric concepts. In this blog post, I’ll guide you through the process of drawing a semi – circle on a Canvas, and also share some insights as a Canvas supplier. Canvas

Understanding the Basics of the Canvas
Before we start drawing a semi – circle, it’s essential to understand what a Canvas is. The HTML5 Canvas is an element that provides a graphics surface on a web page. Using JavaScript, we can manipulate this surface to draw shapes, animate objects, and create interactive graphics.
To start using the Canvas, you need to create a <canvas> element in your HTML file. Here’s a basic example:
<canvas id="myCanvas" width="400" height="400"></canvas>
In JavaScript, we can then access the Canvas and its 2D rendering context:
const canvas = document.getElementById('myCanvas');
const ctx = canvas.getContext('2d');
Drawing a Semi – Circle: The Arc Method
The most common way to draw a semi – circle on a Canvas is by using the arc() method of the 2D context. The arc() method creates an arc (a part of a circle). The signature of the arc() method is as follows:
ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise);
xandy: The coordinates of the center of the circle.radius: The radius of the circle.startAngleandendAngle: The angles in radians where the arc begins and ends.anticlockwise: A boolean value indicating whether the arc should be drawn in an anticlockwise direction.
To draw a semi – circle, we need to define the start and end angles appropriately. A full circle has an angle of 2 * Math.PI radians. So, for a semi – circle, we can set the start angle to 0 and the end angle to Math.PI (for a clockwise semi – circle) or Math.PI to 2 * Math.PI (for an anticlockwise semi – circle).
Here’s an example code snippet to draw a clockwise semi – circle:
const canvas = document.getElementById('myCanvas');
const ctx = canvas.getContext('2d');
// Center coordinates
const x = canvas.width / 2;
const y = canvas.height / 2;
const radius = 50;
const startAngle = 0;
const endAngle = Math.PI;
const anticlockwise = false;
ctx.beginPath();
ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise);
ctx.stroke();
In this code, we first calculate the center coordinates of the Canvas. Then we define the radius, start angle, end angle, and the direction of the arc. We use beginPath() to start a new path, draw the arc using arc(), and finally, we use stroke() to draw the outline of the semi – circle.
Customizing the Semi – Circle
Once you have drawn a basic semi – circle, you can customize it in various ways.
Filling the Semi – Circle
Instead of just drawing the outline, you can fill the semi – circle with a color using the fill() method. Here’s how:
ctx.beginPath();
ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise);
ctx.fillStyle = 'blue';
ctx.fill();
In this example, we set the fillStyle property to 'blue' and then use the fill() method to fill the semi – circle with that color.
Changing the Line Width and Color
You can also change the width and color of the outline of the semi – circle. The lineWidth property sets the width of the line, and the strokeStyle property sets the color of the line.
ctx.beginPath();
ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise);
ctx.lineWidth = 5;
ctx.strokeStyle = 'red';
ctx.stroke();
Drawing Multiple Semi – Circles
You can draw multiple semi – circles on the same Canvas by repeating the drawing process with different parameters. For example, you can draw semi – circles with different radii, positions, or colors.
const canvas = document.getElementById('myCanvas');
const ctx = canvas.getContext('2d');
// Draw the first semi - circle
const x1 = 100;
const y1 = 100;
const radius1 = 30;
ctx.beginPath();
ctx.arc(x1, y1, radius1, 0, Math.PI, false);
ctx.fillStyle = 'green';
ctx.fill();
// Draw the second semi - circle
const x2 = 200;
const y2 = 200;
const radius2 = 40;
ctx.beginPath();
ctx.arc(x2, y2, radius2, 0, Math.PI, false);
ctx.fillStyle = 'orange';
ctx.fill();
As a Canvas Supplier
As a Canvas supplier, I understand the importance of high – quality materials for creating beautiful and precise graphics. Our Canvas products are designed to meet the needs of both professional artists and hobbyists.
We offer a wide range of Canvas sizes and textures. Whether you need a small Canvas for a detailed sketch or a large one for a mural, we have you covered. Our Canvas is made from premium materials that ensure durability and excellent paint adhesion.

When you’re working on projects that involve drawing semi – circles or other complex shapes, having a smooth and consistent Canvas surface is crucial. Our Canvas provides the perfect foundation for your creative endeavors.
Why Choose Our Canvas?
- Quality Assurance: We have strict quality control measures in place to ensure that each Canvas meets our high standards.
- Variety: With a diverse range of sizes and textures, you can find the perfect Canvas for your project.
- Affordability: We offer competitive prices without compromising on quality.
Embroidery Tablecloth If you’re interested in purchasing our Canvas products for your next project, whether it’s a simple semi – circle drawing or a more elaborate artwork, we’d love to have a conversation with you. Reaching out to us is easy, and we’re always here to assist with any questions or product details you may need. Don’t hesitate to get in touch with us to discuss your procurement needs and explore the possibilities our Canvas can offer for your creative journey.
References
- HTML5 Canvas API documentation
- JavaScript for Web Developers textbooks
- Online tutorials on Canvas graphics
Shandong Shengrun Textile Co., Ltd.
With over 15 years of experience, Shandong Shengrun Textile Co., Ltd. is one of the most professional canvas manufacturers and suppliers in China. Please rest assured to buy or wholesale durable canvas in stock here from our factory.
Address: 9th Floor, Hui Ji Business Tower, Ren Cheng District, Ji Ning, Shan Dong, China
E-mail: liang@shengrungroup.com
WebSite: https://www.shengruntextile.com/