lib/wicket/subpoint.rb
# This method evaluates the angle at p2 in radians (180 deg = pi)
This method evaluates the angle at p2 in radians (180 deg = pi)
This method evaluates the angle at p2 in radians ( 180 deg = pi )
def evaluate_angle(p1,p2,p3)
      if straight_line?(p1,p2,p3)
        Math::PI
      else
        a = p2.distance_to(p1)
        b = p2.distance_to(p3)
        c = p1.distance_to(p3)
        Math.acos((a**2 + b**2 - c**2)/(2 * a * b))
      end
    end
def evaluate_angle ( p1 , p2 , p3 ) if straight_line? ( p1 , p2 , p3 ) Math :: PI else a = p2 . distance_to ( p1 ) b = p2 . distance_to ( p3 ) c = p1 . distance_to ( p3 ) Math . acos ( ( a ** 2 + b ** 2 - c ** 2 ) / ( 2 * a * b ) ) end end
This method evaluates the angle at p2 in radians (180 deg = pi)
This method evaluates the angle at p2 in radians ( 180 deg = pi )
p1
<not_specific>
p2
<not_specific>
p3
<not_specific>