js角度与弧度互换
2021-08-14 本文已影响0人
xiabenglakaA
如题:
//角度转弧度
function degToRad(deg){
return Math.PI * 2 * (deg / 360)
}
//弧度转角度
function radToDeg(rad){
return rad * (360 / (Math.PI * 2))
}
//角度转弧度
function degToRad(deg){
return Math.PI * 2 * (deg / 360)
}
//弧度转角度
function radToDeg(rad){
return rad * (360 / (Math.PI * 2))
}