Convert the Cartesian point (x,y) to polar (magnitude, angle) coordinates

def polar(x,y)
  return Math.hypot(y,x), Math.atan2(y,x)
end

赞 (0) 评论 分享 ()