Thread: Co-ordinates
View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.misc
[email protected] mahadevan.swamy@gmail.com is offline
external usenet poster
 
Posts: 59
Default Co-ordinates

Hi Bernie,

This is the logic I have written for the slots being oriented at
different angles.
The way I have numbered is starting with the top right corner of the
rectangle and then top left corner of the rectangle.

Conditions for getting 0

For 0 < angle < 90,
x3<x<x2
y3<y<y2
x4<x<x1
y4<y<y1

For 90<angle<180
x1< x < x4
y4<y<y1
x2<x<x3
y3<y<y2

For 180<angle<270
x1<x<x4
y1<y<y4
x2<x<x3
y2<y<y3

For 270<angle<360
x4<x<x1
y1<y<y4
x2<x<x2
y2<y<y3

The two sets conditions are written for each angle if the sensor is
out of range for the circle and in the range of rectangle at two
places (left and right). In the data structure that you have given me,
I could put up a condition where if the row for slot is equal to 0,
then prevent executing the function that I have written for slot or
else if the sensor is in the range of the circle and rectangle, then
execute the conditions that I have given above. What is your
suggestion?

Thanks
Mahadevan Swamy


On Apr 4, 8:05 pm, wrote:
It can be easy to find thecoordinatesof the 4 corners of the
rectangle since I am given the angle in which the slot (center) is
oriented, the width of the slot and the radius of the slot (semi-
circle) from (0,0). Using cosine law, I can find thecoordinatesof
the corners of the rectangle. Assuming that I am given (x1,y1)......
(x4, y4) for the rectangle how am i going to use this info to see if
the sensor is in that area?

Thanks

Mahadevan Swamy

On Apr 4, 10:56 am, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:





Mahadevan,


I think you would need the XYcoordinatesof the 4 courners of the slot.


Do you have that? Or perhaps we could derive it....


Bernie


wrote in message


oups.com...
I am also given the angle of slot orientation if that helps.


Mahadevan


On Mar 31, 2:28 pm, wrote:


The slot can be oriented anywhere on the part but it has two types as
I have described in my previous post. I am given the radius relative
to the origin for the first type of slot. This radius is the distance
from the orgin to the center of semi-circle. I have another
information which may or may not be useful. The mounting holes (small
holes outside bigger inner hole) has a center line radius measured
with respect to the origin and the slot cannot extend beyond this
radius (for the rectangle part). Small part of the semi-circle is
extended beyond this radius but I am not given the dimension of how
much it has been extended. This applies to both types of slot. I could
scan this picture and send it to you if you want. Thanks for your
assistance.


Mahadevan Swamy


On Mar 30, 4:58 pm, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:


Mahadevan,


Does the slot have a specific orientation, relative to the origin?


HTH,
Bernie
MS Excel MVP


wrote in message


oups.com...
Hi Bernie,


I haven't told you about two design features (holes) of this part. All
this time, we were discussing about parts having some small holes in
different locations and sensors reading them. The design feature I
haven't told you is that there is a bigger inner hole (pilot bore
hole) in the part and all the small holes (mounting holes, sensor
holes etc..) we were discussing about, are outside of this big hole.
This big hole has the coordinate (0,0,r) always. I have managed to use
your formula for that kind of design and sensors will know whether
they are inside the big hole or outside of it.


The next design is a bit tricky. Some parts consists of this hole.
This hole is called a slot which is connected to the bigger inner hole
(pilot bore hole). There are two kinds of slot. One kind of slot looks
like a semi-circle and a rectangle together that is connected to the
pilot bore hole.If you want a picture of this, I can send it to you.. I
am given X, Y, and R coordinate of the semi-circle. I am also given
the absolute reference of this point. The other kind of slot looks
like a wide rectangle but is chamfered in the two corners. For this, I
am given width of the rectangle, radius of the chamfer and distance
from the end of the slot to the orgin. I could consider these slots as
a circle but some area of the hole is omitted which could result
giving wrong values for the sensor, if they are in that area. Is there
a better formula to read these designs?


We will continue our discussion of creating a macro for this later as
I am trying to work on this tricky problem. Thanks


Mahadevan Swamy


On Mar 29, 5:35 pm, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:


Magadevan,


You could write a macro to take the values from a data table, paste
them
into your worksheet with the formula table, do a calculation, then
copy the
results into another table. That way, you would not have a HUGE
workbook,
and the processing would be relatively quick.


Let me know if you want to do the macro. If you do, I would need to
know
your data structure, and how you would want the resulting table
organized.
I would suggest three sheets: one for the data table, one for the
formula
table, and one for results, though all three could go onto one sheet,
in
different areas.


HTH,
Bernie
MS Excel MVP


wrote in message


oups.com...
Hi Bernie,


Thanks a ton. I would appreciate your advise on how I can organize my
data structure as I have to do the same thing for 1000 part patterns.
I was hoping to create a function that can scan the part holeco- ordinates(in one row) and then in another worksheet, report what each
sensor got for the corresponding part number. Is there an easier way
to summarize the sensor findings by performing all mathematical
calculations in one formula? Thanks for your help


Mahadevan Swamy


On Mar 28, 6:00 pm, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:


Mahadevan,


=IF(SUM(E5:AJ5) = 32,1,
IF(ISNUMBER(MATCH(0,E5:AJ5,FALSE)),0,IF(ISNUMBER(M ATCH("X",E5:AJ5,FALSE)),"***X","Other")))


Should work: - change the E5:AJ5 to the range address, and change
the 32
to
the maximum expected number of 1's.


HTH,
Bernie
MS Excel MVP


wrote in message


roups.com...


Hi Bernie,


Thanks for your unique solution. It helped me a lot. I would like
to
know how I can summarize the table of values that I got. For
example,
I got a row of 1's, so I want the result to be a 1 for the
particular
sensor. If there is 0 or X anywhere in the row, I want the result
to
be 0 or X. There can be only one value for the sensor. Is there a
function that will do this job? Thanks for your help


Mahadevan Swamy


On Mar 28, 9:11 am, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
Mahadevan,


You could make a table, with the 'sensor' circle data starting in
row
5,
in columns B (X
coordinate), C (Y coord), and D (R values). Put the 'hole'
circle
data,
starting in Column E in
rows 2 (X coord), 3 (Y coord), and 4 (R value). (Row 1 and column
A
could
be used for data).


Then in cell E5:


=IF(SQRT(($B5-E$2)^2+($C5-E$3)^2) = ($D5+E$4),"Touching",
IF(SQRT(($B5-E$2)^2+($C5-E$3)^2) <=
ABS($D5-E$4),"Completely
Overlapping",IF(SQRT(($B5-E$2)^2+($C5-E$3)^2)
<
($D5+E$4),"Partially
Overlapping",
"Separated")))


Copy this to match both your sensor and hole data, from E5, to
say,
E5:AA40, and you will get a
table of values - again, change the strings to whatever numeric
values
you want to have returned.


HTH,
Bernie
MS Excel MVP


wrote in message


roups.com...


Hi Bernie,


Thank you for your solution. I have a very complicated problem.
The
problem is that I have a big circle which consists of 32 small
circles
oriented in different places. These circles are sensors that
has to
read a part. When the blueprint of the part is placed on top of
these
sensors, these sensors should read the part. This blueprint
consists
of holes in the drawing and where ever there is a hole on top
of the
sensor, the sensor should read 0 or else a 1. That;s why we
were
discussing a small aspect of the problem.


I have a row that consists of X, Y and Rcoordinatesfor each
hole in
the part and a list of sensors with their X,Y and R
coordinates. I am
trying to build a logic that will help me to see whether the
sensor
is
in the range of the hole and execute decisions to produce some
results. I would like to send my files to you if you want to
take a
look at them to understand them better. I would appreciate your
help
on this. Thanks


Mahadevan


On Mar 27, 12:56 pm, "Bernie Deitrick" <deitbe @ consumer dot
org
wrote:
Mahadevan,


Simple algebra: The distance between two points is the square
root
of
the sum of the squares of
the
differences between the X values and Y values (Pythagorean
Theorom):


With X values in row 1, Y values in row 2, R values in row 3,
and
values for circle


...

read more »