Skip to content

Commit

Permalink
Fix for odd errors I was getting. Heading#delta's to was sometimes not
Browse files Browse the repository at this point in the history
a float. Dunno why. Couldn't properly track it back because of randomness.
  • Loading branch information
zenspider committed May 20, 2013
1 parent 00a1962 commit 431c46a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rtanque/heading.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def initialize(radians = NORTH)
def delta(to)
diff = (to.to_f - self.to_f).abs % FULL_ANGLE
diff = -(FULL_ANGLE - diff) if diff > Math::PI
to < self ? -diff : diff
to.to_f < self.to_f ? -diff : diff
end

# @return [RTanque::Heading]
Expand Down Expand Up @@ -159,4 +159,4 @@ def to_degrees
@memoized[:to_degrees] ||= (self.radians * 180.0) / Math::PI
end
end
end
end

0 comments on commit 431c46a

Please sign in to comment.