I have the area like in the below. I am generating random coordinates between this coordinate map. When the randomly generated number comes (0.3,-0.3) I did easily program that it recognizes this coordinate belongs to Area F but how can I determine the bounds of A / B / D / E to recognize if the randomly generated coordinate belongs to these areas? What are the bounds of Area E for writing an if statement to recognize if randomly generated coordinate inside of it?
D
& E
D
and E
is made of all the coordinates such that x == y
and both x
and y
are negative, i.e x,y < 0
. In other words the equation of the line is f(x)=x
x < y
and both x
and y
are negative will belong to the area D
.x > y
and both x
and y
are negative will belong to the area E
.A
& B
f(x)=1-x
and both x
and y
are positive, i.e x,y > 0
(which you can easily deduce yourself if you take few coordinates that belongs to this line and try to figure out how you will get the y
coordinate from the x
)y < 1-x
and both x
and y
are positive belongs to area A
.y > 1-x
and both x
and y
are positive belongs to area B
.