lib/gamebox/lib/vector2.rb
# Sets this vector to the vector projection (aka vector resolute)
# of this vector onto the other vector. See also #projected_onto.
# 
Sets this vector to the vector projection (aka vector resolute)
of this vector onto the other vector.
Sets this vector to the vector projection ( aka vector resolute ) of this vector onto the other vector .
def project_onto!( vector )
    raise "can't modify frozen object" if frozen?
    b = vector.unit
    @x, @y = *(b.scale(self.dot(b)))
    @hash = nil
    self
  end
def project_onto! ( vector ) raise "can't modify frozen object" if frozen? b = vector . unit @x , @y = * ( b . scale ( self . dot ( b ) ) ) @hash = nil self end
Sets this vector to the vector projection (aka vector resolute)
of this vector onto the other vector.
Sets this vector to the vector projection ( aka vector resolute ) of this vector onto the other vector .
vector
<not_specific>