Convert PHP code into Ruby!
RSS icon Email icon Home icon
  • acos

    Posted on March 17th, 2009 RubyLove No comments

    Returns the arc cosine of the argument provided in radians.

    PHP

    echo acos(0.7);
    // => 0.79539883018414;

    Ruby

    puts Math.acos(0.7);
    # => 0.79539883018414;
  • cos

    Posted on March 14th, 2009 RubyLove No comments

    Returns the cosine of the argument provided in radians.

    PHP

    echo cos(0.5);
    // => 0.87758256189037;

    Ruby

    puts Math.cos(0.5);
    # => 0.877582561890373;