javascript画圆
来源:互联网 发布:spring 编程实例 编辑:程序博客网 时间:2024/05/18 09:10
圆的参数方程 x=a+r cosθ y=b+r sinθ (a,b)为圆心坐标 r为圆半径 θ为参数
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> span{position:absolute; color: red} </style> </head> <body> </body> <script type="text/javascript"> //<![CDATA[ var showCircle = function() { var PI = Math.PI; return { draw: function(r/*半径*/, _x/*x轴偏移*/, _y/*y轴偏移*/) { // 获得x y坐标 var x, y; for(var i = 0; i < 360; i += 6) { x = Math.cos(PI / 180 * i) * r + _x; y = Math.sin(PI / 180 * i) * r + _y; var O = document.createElement('span'); O.appendChild(document.createTextNode('.')); document.body.appendChild(O); O.style.left = x + 'px'; O.style.top = y + 'px'; } } } }(); showCircle.draw(100, 400, 200); //]]> </script></html>
- javascript画圆
- html中javascript画圆
- Javascript
- JavaScript
- javascript
- javascript
- javascript
- javascript
- javascript
- JavaScript
- javascript
- JavaScript
- Javascript
- javascript
- javascript
- JavaScript
- javascript
- javascript
- [iOS]设置界面快速生成脚手架介绍
- linux字符设备驱动学习笔记3
- 直接POST过去报文 以及解析xml报文方法
- flex 日期处理工具类
- 学习笔记(3)~Java中的abstract
- javascript画圆
- 8.15 replace type code with state/strategy (以state/strategy取代类型码)
- 经典c语言程序设计实例一
- flex 加载gif图片
- 算法总结(集体编程智慧) - 分类
- Android程序的入口点
- 【转】LDA预备知识
- 反向代理与squid
- Linux怎么自动启动Oracle服务和ArcSDE服务