使用路径arc-奥运五环

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>奥运五环</title>
</head>
<body>
<canvas id="myCanvas" width="500" height="500" style="border-style:dashed;border-width:thin"></canvas>
<script>
/*arc(x, y, radius, startAngle, endAngle, counterclockwise)
参数 描述
x, y 描述弧的圆形的圆心的坐标。
radius 描述弧的圆形的半径。
startAngle, endAngle 沿着圆指定弧的开始点和结束点的一个角度。这个角度用弧度来衡量。
沿着 X 轴正半轴的三点钟方向的角度为 0,角度沿着逆时针方向而增加。
counterclockwise 弧沿着圆周的逆时针方向(TRUE)还是顺时针方向(FALSE)遍历。*/
var canvas = document.getElementById("myCanvas");
//返回绘图对象
var ctx = canvas.getContext("2d");
//坐标,圆半径
ctx.lineWidth = 5;
ctx.strokeStyle = "#163B62";
ctx.beginPath();
ctx.arc(70, 70, 40, 0, Math.PI * 2, false);
ctx.stroke();
ctx.strokeStyle = "#000000";
ctx.beginPath();
ctx.arc(160, 70, 40, 0, Math.PI * 2, false);
ctx.stroke();
ctx.strokeStyle = "#BF0628";
ctx.beginPath();
ctx.arc(250, 70, 40, 0, Math.PI * 2, false);
ctx.stroke();
ctx.strokeStyle = "#EBC41F";
ctx.beginPath();
ctx.arc(110, 110, 40, 0, Math.PI * 2, false);
ctx.stroke();
ctx.strokeStyle = "#198E4A";
ctx.beginPath();
ctx.arc(200, 110, 40, 0, Math.PI * 2, false);
ctx.stroke();
//开始调节
ctx.strokeStyle = "#163B62";
ctx.beginPath();
ctx.arc(70, 70, 40, Math.PI * 1, Math.PI * 2.4, false);
ctx.stroke();
ctx.strokeStyle = "#000000";
ctx.beginPath();
ctx.arc(160, 70, 40, Math.PI * 1.6, Math.PI * 2.3, false);
ctx.stroke();
ctx.strokeStyle = "#BF0628";
ctx.beginPath();
ctx.arc(250, 70, 40, Math.PI * 2, Math.PI * 2.9, false);
ctx.stroke();
ctx.strokeStyle = "#000000";
ctx.beginPath();
ctx.arc(160, 70, 40, Math.PI * 2, Math.PI * 2.8, false);
ctx.stroke();
</script>
</body>
</html>
使用路径arc-奥运五环的更多相关文章
- canvas一周一练 -- canvas绘制奥运五环(1)
运行效果: <!DOCTYPE html> <html> <head> </head> <body> <canvas id=" ...
- 【MATLAB】用MATLAB绘制奥运五环
[MATLAB]用MATLAB绘制奥运五环 今天用MATLAB绘制了一个奥运五环,好吧,实际上是帮人做作业,嘿嘿. 贴代码: clear; clc; N = 1000; angle = linspac ...
- Python绘制奥运五环
绘制奥运五环主要涉及到Python中的turtle绘图库运用: turtle.forward(distance) 向当前画笔方向移动distance像素长度 turtle.backward(dista ...
- Div+Css中transparent制作奥运五环
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- python3 turtle画正方形、矩形、正方体、五角星、奥运五环
python3 环境 turtle模块 分别画出 正方形.矩形.正方体.五角星.奥运五环 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:H ...
- 【scratch3.0教程】 2.3 奥运五环
(1)编程前的准备 在设计一个作品之前,必须先策划一个脚本,然后再根据脚本,收集或制作素材(图案,声音等),接着就可以启动Scratch,汇入角色.舞台,利用搭程序积木的方式编辑程序,制作出符合脚本的 ...
- html+css实现奥运五环(环环相扣)
<!DOCTYPE html> <html> <head> <title>奥运五环</title> <style type=" ...
- python使用turtle库绘制奥运五环
效果图: #奥运五环 import turtle turtle.setup(1.0,1.0) #设置窗口大小 turtle.title("奥运五环") #蓝圆 turtle.pen ...
- 使用路径arc
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> < ...
随机推荐
- 02: DOM 实例
1.1 Event 对象 <body> <a id="myAnchor" href="http://www.microsoft.com"> ...
- 20145101 《Java程序设计》第7周学习总结
20145101<Java程序设计>第7周学习总结 教材学习内容总结 第十二章 Lambda Lambda表达式中this的参考对象以及toString()的接受者,是来自Lambda的周 ...
- Python之GUI的最终选择(Tkinter)
首先,Tkinter是Python默认的GUI库,想IDLE就是用Tkinter设计出来的,因此直接导入Tkinter模块就可以啦 1 import tkinter (1)Tkinter初体验: 1 ...
- 第八章 对称加密算法--AES
注意:本节内容主要参考自<Java加密与解密的艺术(第2版)>第7章“初等加密算法--对称加密算法” 8.1.AES 特点: 密钥建立时间短.灵敏性好.内存需求低(不管怎样,反正就是好) ...
- Java 多线程查找文件中的内容
学过了操作系统,突然不知道多线程有什么用了. 看了一下百度,发现多线程,可以提升系统利用率 在系统进行IO操作的时候,CPU可以处理一些其他的东西,等IO读取到内存后,CPU再处理之前的操作. 总之可 ...
- Java ArrayDeque源码剖析
ArrayDeque 本文github地址 前言 Java里有一个叫做Stack的类,却没有叫做Queue的类(它是个接口名字).当需要使用栈时,Java已不推荐使用Stack,而是推荐使用更高效的A ...
- React Native控件之Switch开关
这个组件很简单 主要有两个属性:开.关....呵呵哒,,, import React,{Component}from 'react'; import { AppRegistry, StyleSheet ...
- Springboot 学习遇到的一些错和埋坑之旅
1. java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Cont ...
- 《剑指offer》第二十三题(链表中环的入口结点)
// 面试题23:链表中环的入口结点 // 题目:一个链表中包含环,如何找出环的入口结点?例如,在图3.8的链表中, // 环的入口结点是结点3. #include <iostream> ...
- input聚焦后光标移动至末尾
var valSrc=obj.val();obj.val(“”).focus().val(valSrc);