Hello,
I have to calculate an angle beetween two UIImageView and i don't find how to get the UIImageViews coordinates(the four corners coordinates). Is there a property for that?
thanks
Hello,
I have to calculate an angle beetween two UIImageView and i don't find how to get the UIImageViews coordinates(the four corners coordinates). Is there a property for that?
thanks
self.frame
will give you a CGRect with the coordinates of the view.
You should be able to find any angle with trigonometric functions.
For example, this will find the angle between the centers of two UIImageViews that share a superview:
angle = tan((imageView1.center.y-imageView2.center.y),
(imageView1.center.x-imageView2.center.x));
It is important that they are in the same superview, otherwise the coordinates will be different. To find angles you need to have an understanding of basic trigonometry.