lib/measures/tbd/resources/geometry.rb
def angle(other)
      return nil unless other.is_a?(Topolys::Vector3D)
      prod = magnitude * other.magnitude
      return nil if prod.zero?
      val = dot(other) / prod
      val = [-1.0, val].max
      val = [ val, 1.0].min
      Math.acos(val)
    end
##
# Gets angle [0,PI) between self & another 3D vector
#
# @param [Vector3D] other Another 3D vector
#
# @return [Float] Returns angle - nil if not Vector3D objects
Gets angle [0,PI) between self & another 3D vector
Gets angle [ 0 PI ) between self & another 3D vector
def angle(other)
      return nil unless other.is_a?(Topolys::Vector3D)
      prod = magnitude * other.magnitude
      return nil if prod.zero?
      val = dot(other) / prod
      val = [-1.0, val].max
      val = [ val, 1.0].min
      Math.acos(val)
    end
def angle ( other ) return nil unless other . is_a? ( Topolys :: Vector3D ) prod = magnitude * other . magnitude return nil if prod . zero? val = dot ( other ) / prod val = [ - 1.0 , val ] . max val = [ val , 1.0 ] . min Math . acos ( val ) end
Gets angle [0,PI) between self & another 3D vector
Gets angle [ 0 PI ) between self & another 3D vector
Returns angle - nil if not Vector3D objects
Returns angle - nil if not Vector3D objects
Float
other
other Another 3D vector
other Another 3D vector