<title>用canvas画布绘制等腰三角形</title>
</head>
<body>
<canvas id="mycan"></canvas>
<script>
window.onload = function(){
// 抓取元素
var mycan = document.getElementById('mycan');
// 设置宽度和高度
mycan.width =900;
mycan.height =900;
// 设置画布的边框
mycan.style.border = '1px solid blue';
// 调用getContext(),返回给我们一个对象,这个对象里提供了若干个方法,供我们去绘制图形
var ctx =mycan.getContext('2d');
console.log(ctx);
// 绘制路径起点
ctx.beginPath();
// 400 * Math.sin(Math.PI/3)
// Math.floor()
//var height = Math.floor(400 * Math.sin(Math.PI/3));
var height