Find the directional vector of an object and the centre of square

related:

https://stackoverflow.com/questions/70731179/find-the-directional-vector-of-an-object-and-the-centre-of-square