Hi,
I have a sensor in the shape of a small circle and a hole which is larger than the sensor circle. Basically i have a small circle and a large circle. Now i would like to check these conditions:
(1) IF the small circle is in the range of the large circle, then the result should be 0.
(2) IF the small circle is not in the range of the large circle, the result should be 1.
(3) IF the small circle is partially blocked by the larger circle or very close to it by 0.03 from inside or outside the larger circle, then the result should be X.
I don't want to write any coding for this right now but a simple logic statements in the form of IF conditional statements.
This is what I have so far. Please feel free to correct my logic statements
r1 is radius of larger circle and same applies to x1,y1
r2 is the radius of smaller circle and same applies to x2,y2
(1) IF(SQRT((X2-X1)^2+(Y2-Y1)^2)< abs(R2-R1), THEN THE VALUE IS 0
(2) IF(SQRT((X2-X1)^2+(Y2-Y1)^2)> abs(R2-R1), THEN THE VALUE IS 1
(3) (a) IF(SQRT((X2-X1)^2+(Y2-Y1)^2)<= R1+R2, (from outside of the larger circle), THEN VALUE IS X
(b) IF(SQRT((X2-X1)^2+(Y2-Y1)^2)= abs(R2-R1), (from the inside of the larger circle), THEN VALUE IS X.
Now my only problem is this: -
When the edge of the larger circle is very close to the smaller circle by 30 thou or touching, it should be regarded as X (in other words, it should not exceed 0.03 or else it would be a 1 or a 0 depending on whether the sensor in inside the hole or outside of it). Can anybody please help me out? Thanks in advance.
I have a sensor in the shape of a small circle and a hole which is larger than the sensor circle. Basically i have a small circle and a large circle. Now i would like to check these conditions:
(1) IF the small circle is in the range of the large circle, then the result should be 0.
(2) IF the small circle is not in the range of the large circle, the result should be 1.
(3) IF the small circle is partially blocked by the larger circle or very close to it by 0.03 from inside or outside the larger circle, then the result should be X.
I don't want to write any coding for this right now but a simple logic statements in the form of IF conditional statements.
This is what I have so far. Please feel free to correct my logic statements
r1 is radius of larger circle and same applies to x1,y1
r2 is the radius of smaller circle and same applies to x2,y2
(1) IF(SQRT((X2-X1)^2+(Y2-Y1)^2)< abs(R2-R1), THEN THE VALUE IS 0
(2) IF(SQRT((X2-X1)^2+(Y2-Y1)^2)> abs(R2-R1), THEN THE VALUE IS 1
(3) (a) IF(SQRT((X2-X1)^2+(Y2-Y1)^2)<= R1+R2, (from outside of the larger circle), THEN VALUE IS X
(b) IF(SQRT((X2-X1)^2+(Y2-Y1)^2)= abs(R2-R1), (from the inside of the larger circle), THEN VALUE IS X.
Now my only problem is this: -
When the edge of the larger circle is very close to the smaller circle by 30 thou or touching, it should be regarded as X (in other words, it should not exceed 0.03 or else it would be a 1 or a 0 depending on whether the sensor in inside the hole or outside of it). Can anybody please help me out? Thanks in advance.
Comment