Advertisement
Guest User

Untitled

a guest
May 27th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.78 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!--
  3. To change this license header, choose License Headers in Project Properties.
  4. To change this template file, choose Tools | Templates
  5. and open the template in the editor.
  6. -->
  7. <html>
  8.     <head>
  9.         <title>TODO supply a title</title>
  10.         <meta charset="UTF-8">
  11.         <meta name="viewport" content="width=device-width, initial-scale=1.0">
  12.     </head>
  13.     <body>
  14.         <canvas id="canvas" width="500" height="400" style="border: 1px solid black"></canvas>
  15.         <script>
  16.             var canvas = document.querySelector("#canvas");
  17.             var ctx = canvas.getContext("2d");
  18.            
  19.             ctx.translate(200,200);
  20.             ctx.arc(0, 0, 50, 0, 2 * Math.PI);
  21.             ctx.stroke();
  22.            
  23.             ctx.beginPath();
  24.             ctx.moveTo(0, 0);
  25.             ctx.arc(0, 0, 2, 0, 2 * Math.PI);
  26.             ctx.stroke();
  27.            
  28.             ctx.beginPath();
  29.             ctx.moveTo(0, 10);
  30.             ctx.lineTo(0, -40);
  31.             ctx.stroke();
  32.            
  33.             ctx.beginPath();
  34.             ctx.moveTo(0, -40);
  35.             ctx.lineTo(-5, -35);
  36.             ctx.moveTo(0, -40);
  37.             ctx.lineTo(5, -35);
  38.             ctx.stroke();
  39.            
  40.             ctx.beginPath();
  41.             ctx.moveTo(0, -55);
  42.             ctx.lineTo(0, -45);
  43.             ctx.stroke();
  44.            
  45.             ctx.beginPath();
  46.             ctx.moveTo(0, 55);
  47.             ctx.lineTo(0, 45);
  48.             ctx.stroke();
  49.            
  50.             ctx.beginPath();
  51.             ctx.moveTo(55, 0);
  52.             ctx.lineTo(45, 0);
  53.             ctx.stroke();
  54.            
  55.             ctx.beginPath();
  56.             ctx.moveTo(-55, 0);
  57.             ctx.lineTo(-45, 0);
  58.             ctx.stroke();
  59.         </script>
  60.     </body>
  61. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement