In javascript, we can draw a line in canvas with the length is in pixel. For example:
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.moveTo(0,0);
ctx.lineTo(300,0);
ctx.stroke();
If I want to convert the length of the line to inch or milimeter, is there any way to do that?