I would like to check if two polygons (number of vectors unclear) have the same shape. Without rotations this is easy, but how do I do this with rotated polygons? I need to know the rotation angle, too.
boolean polygonsHaveSameShape(PVector[] polygon1, PVector[] polygon2){
…
}
float getRotationAngle(PVector[] polygon1, PVector[] polygon2){
…
}