Finding a good book to master HTML5 can be very challenging: there are so many around - most with eye-catching titles and very complex substance.
Therefore,
Vivax Solutions strongly recommends
Core HTML5 Canvas for those who really want to delve into HTML5.
Please click the image to access
Amazon:
<script>
{
window.setInterval('bear()', 1000)
function bear() {
var a = (Math.PI / 180) * eval(document.getElementById('ran').value);
var z;
var x = 250 + 150 * Math.cos(a);
var y = 200 + 150 * Math.sin(a);
var canvas = document.getElementById('Canvas_Six');
var context_six = canvas.getContext('2d');
context_six.clearRect(0, 0, 500, 400);
// Vertical line
context_six.beginPath();
context_six.moveTo(250, 200);
context_six.lineTo(250, 4);
context_six.lineWidth = 5;
context_six.strokeStyle = 'blue';
context_six.stroke()
context_six.closePath();
// Moving line
context_six.beginPath();
context_six.moveTo(250, 200);
context_six.lineTo(x, y);
context_six.lineWidth = 5;
context_six.strokeStyle = 'purple';
context_six.stroke()
context_six.closePath();
// Arc
context_six.beginPath();
context_six.arc(250, 200, 150, 1.5 * Math.PI, a);
context_six.strokeStyle = 'red';
context_six.stroke()
// Text
context_six.font = 'bold 20pt Calibri';
context_six.fillStyle = 'red';
context_six.fillText('N', 220, 20);
context_six.font = 'bold 20pt Calibri';
context_six.fillStyle = 'blue';
context_six.fillText('A', 246, 220);
context_six.font = 'bold 20pt Calibri';
context_six.fillStyle = 'blue';
context_six.fillText('B', x, y);
context_six.font = 'bold 30pt Calibri';
context_six.fillStyle = 'blue';
context_six.fillText('^', 240, 25);
if (a + 90 <= 90) {
z = 'Bearings of B from A = 0' + (eval(document.getElementById('ran').value) + 90);
document.getElementById('p').innerHTML = z + '0';
}
else {
z = 'Bearings of B from A = ' + (eval(document.getElementById('ran').value) + 90);
document.getElementById('p').innerHTML = z + '0';
}
}
</script>