Warning: Undefined variable $position in /home/pystyles/pystyle.info/public_html/wp/wp-content/themes/lionblog/functions.php on line 4897

numpy – ラジアン、度を相互に変換する関数の使い方

numpy – ラジアン、度を相互に変換する関数の使い方

概要

NumPy でラジアン、度を相互に変換するための関数について解説します。

Advertisement

numpy.deg2rad

角度を度からラジアンに変換します。

numpy.deg2rad(x, /, out=None, *, where=True, casting="same_kind", order="K", dtype=None, subok=True[, signature, extobj]) = <ufunc "deg2rad">
引数
名前 デフォルト値
x array_like
度単位の角度。
返り値
名前 説明
y 対応する角度をラジアンで表す。x がスカラならこれはスカラです。

サンプルコード

numpy.degrees

角度をラジアンから度に変換します。

numpy.degrees(x, /, out=None, *, where=True, casting="same_kind", order="K", dtype=None, subok=True[, signature, extobj]) = <ufunc "degrees">
引数
名前 デフォルト値
x array_like
ラジアン単位の入力配列。
返り値
名前 説明
y out が与えられた場合は、その参照先となります。x がスカラの場合、これはスカラです。

サンプルコード

numpy.rad2deg

角度をラジアンから次数に変換します。

numpy.rad2deg(x, /, out=None, *, where=True, casting="same_kind", order="K", dtype=None, subok=True[, signature, extobj]) = <ufunc "rad2deg">
引数
名前 デフォルト値
x array_like
ラジアン単位の角度。
返り値
名前 説明
y 対応する角度を度数で表す。x がスカラーの場合、これはスカラーです。

サンプルコード

numpy.radians

角度を度からラジアンに変換します。

numpy.radians(x, /, out=None, *, where=True, casting="same_kind", order="K", dtype=None, subok=True[, signature, extobj]) = <ufunc "radians">
引数
名前 デフォルト値
x array_like
度単位の入力配列。
返り値
名前 説明
y 対応するラジアン値。x がスカラの場合はスカラである。

サンプルコード