swift - Get specific corner co-ordinates of UIView/UIImageView irrespective of its rotation -


i have simple uiimageview of in screen follow:

to co-ordinates of highlighted corner of uiimageview, use simple formula:

cgpointmake(cgrectgetmaxx(imageview.frame), cgrectgetmaxy(imageview.frame))

now rotate imageview , looks follows:

after rotation, how can co-ordinates of highlighted point? because after rotation, previous code not applicable.

you can consult next link topic: transformation of coordinates involving rotation

https://www.math10.com/en/geometry/analytic-geometry/geometry1/coordinates-transformation.html

it applies cos , sin functions calculate (x,y) in new rotated coordinate system. need rotation angle.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -