phetsims / dot

A math library with a focus on mutable and immutable linear algebra for 2D and 3D applications.
http://scenerystack.org/
MIT License
13 stars 6 forks source link

convert Vector2/3/4 methods to standard getter pattern #87

Closed pixelzoom closed 5 years ago

pixelzoom commented 5 years ago

I took a look at all of the Vector2, Vector3, and Vector4 methods that take zero arguments, i.e. function(). Discussed with @jonathanolson and here are our conclusions.

These were already converted by @samreid and @Denz1994 in https://github.com/phetsims/dot/issues/84:

These methods are operations that mutate the Vector2 instance. We won't change these.

These methods are operations that return a new instance. There's a well-established naming convention that associates these methods with their mutator versions (e.g. normalize and normalized), and that convention is used throughout dot. So we won't change these.

So that leaves only 2 methods to convert:

chrisklus commented 5 years ago

I'm jumping on perpendicular, @jbphet is on magnitudeSquared.

jbphet commented 5 years ago

The conversions for magnitudeSquared and perpendicular sound now be complete. Marking for dev meeting to decide who is up next.

samreid commented 5 years ago

It appears those were the last two. @jbphet if you concur, this issue can be closed. If I'm wrong, please let me know and re-label for dev meeting.

pixelzoom commented 5 years ago

Yes indeed, those were the last 2 that @jonathanolson and I identified in https://github.com/phetsims/dot/issues/87#issue-413131104. So I'll take the liberty of closing. Feel free to reopen if there's anything I've missed here.