Math.atan2

X,Y座標の角度を得る

構文

Math.atan2(x,y)

引数

x=X座標, y=Y座標

例文

<html>
<head>
<title>Math.atan2</title>
</head>

<body>

<!--X,Y座標の角度を得るのサンプル-->
<script type="text/javascript">
document.write(Math.atan2(0.50,0.50)+"<br>");
document.write(Math.atan2(-0.50,-0.50)+"<br>");
document.write(Math.atan2(5,5)+"<br>");
document.write(Math.atan2(10,20)+"<br>");
document.write(Math.atan2(-5,-5)+"<br>");
document.write(Math.atan2(-10,10));
</script>

</body>
</html>

関連記事

スポンサーリンク

SetTextColor - テキストの描画色指定

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る