phetsims / dot

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

Convert repo to TypeScript #125

Open zepumph opened 7 months ago

zepumph commented 7 months ago

I'm surprised to still see so much in JavaScript over here in dot. I ran into this with Bounds3, and will convert it as I butt up against it over in https://github.com/phetsims/density-buoyancy-common/issues/98

zepumph commented 7 months ago

image

zepumph commented 7 months ago

It looks like there was a bug in Bounds3.transform. The jsdoc said that it wanted a Matrix4, but the implementation seems dependent on Matrix3. I added TODOs pointing to this issue. @jonathanolson can you help out with this? I don't see Matrix4.isIdentity().

https://github.com/phetsims/dot/blob/8a8ed845d3f0c1e1518cefb0860562e6fe0a7897/js/Bounds3.ts#L872

jonathanolson commented 7 months ago

It should eventually support Matrix3 (just a rotation) or Matrix4 (rotation + translation).

samreid commented 7 months ago

I'll work on converting Complex.js to TypeScript.

samreid commented 7 months ago

I'll work on Random.js next.

jonathanolson commented 2 months ago

Resolved the Bounds3 bug, now using Matrix4. Unassigning. Matrix4 should be upgraded to match Matrix3 when more work is done on it.