victor icon indicating copy to clipboard operation
victor copied to clipboard

A JavaScript 2D vector class with methods for common vector operations

Results 20 victor issues
Sort by recently updated
recently updated
newest added

In this PR, I added two new methods: isParallelTo and isPerpendicularTo. As the names suggest, they check whether the vector is parallel or perpendicular to another vector.

It was very annoying for me that methods like `add` or `divide` modified the vector. My temporary solution is my [immutable-vector2d](https://github.com/neojski/immutable-vector2d) library. Do you have any ideas as how to...

[Documentation for divide](http://victorjs.org/#divide) says that the argument is scalar but the example says it's `Victor`.

Maybe add a .fromAngleRad( angle ) such as: ``` javascript Victor.fromAngleRad = function ( angle ) { return new Victor(Math.cos( angle ), Math.sin( angle )); } ```

I know you can just v.multiply(new Victor(n, n)) where n is the scalar you want, but this is kind of a hack, and a dedicated scalar multiplication method would be...

This prevents the creation of a new temporary Victor object in the normalize function and should make things very slightly faster

It's easy to do a lot of things by accident IE: Using a scalar in ".multiply()" method, or taking the dot product of a scalar instead of another vector. When...

Hi! I have issue, written in name of topic. I haven't `commonjs` in my project, but `victor` is great, but i cannot use it in my project, because npm module...

'Fixing issue #32 set magnitude length'

These are all expected to return the same vector back but rotate them 45 degrees instead. ``` (new Victor(1,1)).rotateBy(0) (new Victor(0,1)).rotateBy(0) (new Victor(0,-1)).rotateBy(0) (new Victor(-1,-1)).rotateBy(0) ```