Apply LinearTransformation to a Rectangle

I have represented a box as a 4 col x 2 row matrix

something like bbox = [0 0 ; 50 0; 50 100; 0 100]

I have a few of these boxes and I want to rotate them by a certain angle.
I create a LinearMap(RotMatrix(deg2rad(angle))) … now how do I use this to transform the coordinates?

bbox = 4×2 Matrix{Int64}:
 396   979
 424   979
 424  1009
 396  1009

>>> warp(bbox', LinearMap(RotMatrix(deg2rad(180))))
2×4 OffsetArray(::Matrix{Float64}, -2:-1, -4:-1) with eltype Float64 with indices -2:-1×-4:-1:
 1009.0  1009.0  979.0  979.0
  396.0   424.0  424.0  396.0

So it changed the shape of the matrix too?

>>> LinearMap(RotMatrix(deg2rad(180))) * bbox'
No method matching .... found .... 

So I also can’t treat it like a matrix and multiply it directly.

How do I do this?

You could define your own rotation matrix:

rot(θ) = [cosd(θ) -sind(θ); sind(θ) cosd(θ)]

box = [0 0 ; 50 0; 50 100; 0 100]'
rbox30 = rot(30)*box