![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
今回の記事の目的はProcessingの「degrees()関数」を理解し、自分なりに使ってみること。
この記事を書いた人
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-user-profile-illustrationi-light-blue.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-user-profile-illustrationi-light-blue.png)
- クリエイティブコーディングで制作した作品と、上達のためにやったこと・学習過程を発信
- コンセプトは「クリエイティブコーディング1万時間の歩き方」
- 2024年にProcessingの構文のアウトプットを終え、2025年から作品制作開始(クリエイティブコーディングで作成した作品集)
目次
【Processing】degrees()関数について
degrees()関数について
- 英語で「degrees」は「度数」を意味する
- degrees()関数はラジアン(角度の単位)を度に変換します
- ラジアン(数値)0.00を0度に
- ラジアン(数値)1.57を90度に
- ラジアン(数値)3.14を180度に
- ラジアン(数値)4.71を270度に
- degrees()関数は、回転を表すときに役に立ちます。0から360の範囲で角度を扱うことができるので、直感的に角度を理解できます
- 注意点は度数とラジアンの違いを理解しておくこと
【Processing】degrees()関数の書き方【構文】
degrees()関数の書き方【構文】
- degrees(radians)
- radiansはラジアン(数値)
【Processing】degrees()関数の使い方【画像とコード】
![ラジアン(数値)を角度に変化させる](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/10/processing-degrees-function-converting-radians-to-degrees1.png)
![ラジアン(数値)を角度に変化させる](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/10/processing-degrees-function-converting-radians-to-degrees1.png)
//日本語を表示させるために必要
PFont font = createFont("Meiryo", 50); textFont(font);
float rad = 1.57; // ラジアン数値が1.57
float deg = degrees(rad); //1.57を角度に変化させる
// 角度とラジアン数値をコンソールに表示させる
// ラジアンは約1.57になる
println(rad + "ラジアン数値 " + deg + "角度");
【Processing】degrees()関数はどんな表現で使えそうか
角度を使った表現をしたいときに使うかな。
【Processing】degrees()関数を使ってみた感想
角度とラジアン(数値)の違いが分かってよかったです。
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
それでは今日もレッツワクワクコーディング。