bot.dart
bot.dart copied to clipboard
What geometric class to we need
I think about to implement line, ellipse, triangle, rect, polygon classes. Also the Size class needs to be rewritten as it only works for rects. Btw. why is the rect class called PRect?
RE: Rect: there's already a Rect type defined in a core library that was causing naming conflicts.
Most of my inspiration has come from the Closure library. Here's the github mirror, pointed to the math libraries: https://github.com/jarib/google-closure-library/tree/master/closure/goog/math
Coming from Processing I prefer Karsten Schmitds toxiclibs which has some more geometric stuff. https://bitbucket.org/postspectacular/toxiclibs/src/35d289f02791/src.core/toxi/geom/
Is there a need to make a the constructor of PRect constant?
Ooo. Love the toxic libs. A great place to start.
PRect being const: For these smaller types, I love the idea that they are immutable. Having a const ctor means it can (although doesn't have to be) a compile-time constant.
But you cant change scale, translate the rect after creating, or miss I something here?
But you cant change scale, translate the rect after creating, or miss I something here?
Correct. Operations that scale/traslate the rect should return new Rects.