Could we not have some Operators for gfx::Point to enhance the translate method?
@Operator
Point plus(Point t) { make(x+t.x, y+t.y) }
@Operator
Point minus(Point t) { make(x-t.x, y-t.y) }
brianSun 26 Feb 2012
I have sort of mixed feelings about adding/subtracting two points together myself. I guess I'd like to hear if others think those operators make sense.
SlimerDudeMon 27 Feb 2012
Hmm, I suppose adding/subtracting two Points together is a little odd... but no more than translating a Point by another Point - which exists already:
Point translate(Point t) { make(x+t.x, y+t.y) }
I guess to be mathematically correct there should be Vector objects and stuff, but I don' wanna go there!
SlimerDude Sun 26 Feb 2012
Hi,
Could we not have some Operators for gfx::Point to enhance the translate method?
brian Sun 26 Feb 2012
I have sort of mixed feelings about adding/subtracting two points together myself. I guess I'd like to hear if others think those operators make sense.
SlimerDude Mon 27 Feb 2012
Hmm, I suppose adding/subtracting two
Points
together is a little odd... but no more than translating aPoint
by anotherPoint
- which exists already:I guess to be mathematically correct there should be
Vector
objects and stuff, but I don' wanna go there!