This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// event from touch event on a view | |
const { pageX, pageY } = event.nativeEvent; | |
const x0 = pageX / Metrics.screenWidth; | |
const y0 = pageY / Metrics.screenHeight; | |
const x = y0; | |
const y = -x0 + 1; | |
// x and y have now been rotated 90 deg clockwise and translated back into normalized coordinates. |