E
E
egorkozelskij2017-10-03 23:39:33
Mathematics
egorkozelskij, 2017-10-03 23:39:33

How to make a pixel-by-pixel rotation of a shape (vector)?

There is a square - like a set of pixels.
Represented as a list of points
A = [(i1,j1), (i2,j2) ....]
After rotating this square, I need to get a new list with pixels.
The problem is that if each point of the square is multiplied by the rotation matrix, then not integer values ​​are obtained, but a whole pixel .... As a result, if the whole thing is rounded, then it turns out not quite what you need.
How to get the set of pixels of a rotated square?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2017-10-03
@egorkozelskij

On the contrary - you go through the points of the outer square, which obviously contains the rotated square, and calculate which point of the rotated square you hit (if you hit).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question