Am trying to draw a star using canvas, but the code is not running. I want to understand: what are the steps to measure the Y and X coordinate? How to find them? to draw any
A star is basically a regular polygon with alternating points on an inner and an outer radius.
Here's an example of a flexible function to draw a star shape.
You can set the position, #spikes and the inner & outer radius of the spikes:
Example code and a Demo: http://jsfiddle.net/m1erickson/8j6kdf4o/