Skip to content

Crafty.math.Vector2D improvements#734

Merged
starwed merged 1 commit intocraftyjs:developfrom
mucaho:fix_vector2d
Mar 5, 2014
Merged

Crafty.math.Vector2D improvements#734
starwed merged 1 commit intocraftyjs:developfrom
mucaho:fix_vector2d

Conversation

@mucaho
Copy link
Contributor

@mucaho mucaho commented Feb 14, 2014

this PR was split from #708

  • crossProduct method added
  • adds optional argument to save the result into instead of instantiating a new object
  • various minor test fixes

@starwed
Copy link
Member

starwed commented Mar 5, 2014

This looks good to me, although I honestly have no idea what the (existing) getNorm function would be used for? (Also, it doesn't normalize the resultant vector in one of the use cases, which seems suspicious.)

Anyway, that's a problem with the existing code, so I'll go ahead and merge this.

starwed added a commit that referenced this pull request Mar 5, 2014
Crafty.math.Vector2D improvements
@starwed starwed merged commit 775a281 into craftyjs:develop Mar 5, 2014
@mucaho
Copy link
Contributor Author

mucaho commented Mar 6, 2014

getNormal() returns two different values (depending on whether an optional parameter was filled or not):

  • In the trivial case it returns the perpendicular vector to this vector (maybe add documentation for that?)
  • As you mentioned in your other post, the second return value represents an unit vector perpendicular to the line between two vectors

@mucaho mucaho deleted the fix_vector2d branch March 6, 2014 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants