atan

def setup
  background(220)

  a = PI / 3.0
  t = tan(a)
  at = atan(t)

  div = createDiv("#{a} #{t} #{at}")
  div.position(10, 10)
  div.style('font-size', '14px')
  div.style('width', '100px')
end
def setup
  background(220)

  a = PI + PI / 3.0
  t = tan(a)
  at = atan(t)

  div = createDiv("#{a} #{t} #{at}")
  div.position(10, 10)
  div.style('font-size', '14px')
  div.style('width', '100px')
end

p5.jsリファレンス(参考情報)

[p5.js] atan

概要

アークタンジェント(arc tan)を計算します。

書式

atan(value)

引数

引数名内容備考オプションデフォルト値
value数値

戻値

アークタンジェント(arc tan)の値

備考

・戻値の単位および値は、angleModeの設定に依存します。
  RADIANSの場合 : -PI/2~+PI/2
  DEGREESの場合 : -90~+90

関連

angleMode