I made an Android custom view that looks like a D-Pad (image below). Given the indirect coordinate (x, y), the width of the rectangle (w) and the height of the rectangle (h), ignoring the white diagonal and rounded corners, can someone help me how to determine which triangle to touch the user?
Additional information: (0,0) - upper left corner
: w/2 x h/2 y. ( w , h), : x *= h; x /= w; :
w/2
x
h/2
y
w
h
x *= h; x /= w;
x < 0, |y| < |x| = left x > 0, |y| < |x| = right y < 0, |x| < |y| = up y > 0, |x| < |y| = down
( , x = y = 0, | x | = | y |, , ).
Source: https://habr.com/ru/post/1622282/More articles:DatabaseGeneratedOption not working in Dapper.FastCRUD - c #sbt, ivy, battery life and weirdness - sbtMvc Render Action / Partial to Response Output - asp.net-mvcSetting the color of the text and font UITabBarItem, which causes a strange result in fast - fontshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1622281/elasticsearch-how-to-correctly-point-an-alias-to-an-index&usg=ALkJrhgnebrEEYCrQSAypDsuTW5a4hpWtQTrying to use bootbar navbar and scrollTop () - jqueryHow to get authorization code with OWIN, OAuth and web API? - c #Script, чтобы разделить JS-разделенное запятой объявление var на несколько объявлений var - javascriptLaravel page markup does not work with date search - phpwhy does this map reduce the Promises array doesn't work, but just reduces it? - javascriptAll Articles