i have a leaflet feature rectangle and i need to pragmatically draw another squre rectangle . see the image dotted rectangle is the one i need to calculate
possible solutions
Distance from square vertices to rectangle center is
d = rect_width / 2 + rect_height / 2
So their coordinates are
rect_center_x + d; rect_center_y
rect_center_x; rect_center_y - d
rect_center_x - d; rect_center_y
rect_center_x; rect_center_y + d