Pointwise multiplication and division are common operations, and it would be useful to have concise syntax for them. For instance:
tile_size = Vector(8,16)
tile = Vector(4,5)
screen_pos = tile_pos * tile_size # = Vector(32, 80)
click_pos = Vector(35,82)
click_tile = click_pos // tile_size # = Vector(4,5)
/ and // are available for this purpose, but * is currently in use by the dot product. Repurposing * for pointwise multiplication would make the library usage line up nicely with NumPy, but would make a nasty surprise for anyone relying on the dot product who was unaware of the change. Perhaps ** would be an acceptable alternative?
Pointwise multiplication and division are common operations, and it would be useful to have concise syntax for them. For instance:
/ and // are available for this purpose, but * is currently in use by the dot product. Repurposing * for pointwise multiplication would make the library usage line up nicely with NumPy, but would make a nasty surprise for anyone relying on the dot product who was unaware of the change. Perhaps ** would be an acceptable alternative?