{"ScriptPreparationCode":"canvas = document.getElementById(\u0027myCanvas\u0027);\r\ncontext = canvas.getContext(\u00272d\u0027);\r\n\r\ncenterX = canvas.width / 2;\r\ncenterY = canvas.height / 2;\r\nradius = 100; // Adjust this value to change the size of the circle\r\n\r\nnumLines = 60;\r\n\r\nangleIncrement = (2 * Math.PI) / numLines;\r\n\r\ncos={}\r\nsin={}\r\n\r\n for (let i = 0; i \u003C 60; i\u002B\u002B) {\r\n var angle = i * angleIncrement;\r\n cos[angle] = Math.cos(angle);\r\n sin[angle] = Math.sin(angle);\r\n }","TestCases":[{"Name":"Math","Code":" for (var i = 0; i \u003C numLines; i\u002B\u002B) {\r\n var angle = i*angleIncrement\r\n var x1 = centerX \u002B radius * Math.cos(angle);\r\n var y1 = centerY \u002B radius * Math.sin(angle);\r\n \r\n \tvar x2 = centerX \u002B (radius -10) * Math.cos(angle);\r\n var y2 = centerY \u002B (radius -10) * Math.sin(angle);\r\n \r\n context.beginPath();\r\n context.moveTo(x1, y1);\r\n context.lineTo(x2, y2);\r\n context.stroke();\r\n }","IsDeferred":false},{"Name":"cache","Code":" for (var i = 0; i \u003C numLines; i\u002B\u002B) {\r\n var angle = i*angleIncrement\r\n var x1 = centerX \u002B radius * cos[angle];\r\n var y1 = centerY \u002B radius * sin[angle];\r\n \r\n \tvar x2 = centerX \u002B (radius -10) * cos[angle];\r\n var y2 = centerY \u002B (radius -10) * sin[angle];\r\n \r\n context.beginPath();\r\n context.moveTo(x1, y1);\r\n context.lineTo(x2, y2);\r\n context.stroke();\r\n }","IsDeferred":false},{"Name":"With rotate","Code":" for (var i = 0; i \u003C numLines; i\u002B\u002B) {\r\n var angle = i*angleIncrement\r\n \r\n // Save the current canvas state\r\n context.save();\r\n \r\n // Rotate the canvas\r\n context.translate(centerX, centerY);\r\n context.rotate(angle);\r\n \r\n // Draw the line from the center to the point on the circle\r\n context.beginPath();\r\n context.moveTo(radius, 0);\r\n context.lineTo(radius - 10, 0);\r\n context.stroke();\r\n \r\n // Restore the canvas state for the next iteration\r\n context.restore();\r\n }","IsDeferred":false}]}