Closed edemaine closed 9 months ago
Hi, @edemaine ,
Shape.translate
accepts Vector argument, and Point extend Shape.
I think this is good enough, no need for special add
method for point.
Ahh indeed. Is this in the types? I somehow missed it, but maybe because it's not listed in the docs under Point...
Not listed in Point because it is not in Point. Docs are auto generated.
It seems that it's not possible to add a Point to a Vector (which should produce a Point).
One natural interface would be to add
Point.prototype.add
with aVector
argument. Ideally we could also support an override onVector.prototype.add
.Another natural interface would be to add
Point.prototype.translate
with aVector
argument. This is perhaps more in line with e.g.Polygon.prototype.translate
.Or we could support both. I'm happy to work on a PR if that's helpful.