• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

how can I find the coordinates for this point which is parllel to square shape (extreme right edge

hi
is there a way to determine the two extremes points coordinates (right and left) within the polygon that are parrarel to the square shape in the attached excel file.
 
kindly have alook for the updated file where an module tells you wheather the point is within envelope our out of evelope. hope this will make it little bit easier.
 

Attachments

  • polygon shape.xlsm
    26.3 KB · Views: 6
Left edge is:
=F10+(F11-F10)*(87000-E10)/(E11-E10)

Right edge is:
=F15+(F16-F15)*(87000-E15)/(E16-E15)
 
thank you much but in my situation the point B is not static rather it is dynamic each time i have different location
for that point is there a way to make the formula give different edges based on the location of point B
 

Attachments

  • polygon shape.xlsm
    24.1 KB · Views: 6
Hi Nader ,

I am confused by what you want.

1. Given a point's value on a chart , do you wish to know whether it is inside or outside the shape formed by another chart ?

2. Given a point's value on a chart , do you wish to know where the endpoints of a horizontal straight line passing through this point intersects the shape formed by another chart ?

You have a point atow , which has X and Y values of 200 and 60000. If a horizontal straight line is drawn to pass through this point , it will intersect the polygon at the points 165.5 and 220.

What are the values you have given of 172.543 and 255.8 ?

Narayan
 
@nader assaleh,

This could be an stupid idea but i suggest you to use a scroll bar to vary the coordinates of that point and then note the position of any thing on this chart. See this attached sheet. Thanks
 

Attachments

  • polygon shape - Faseeh.xlsx
    17.1 KB · Views: 3
Hi Narayan
what i mean is
2. Given a point's value on a chart , i wish to know where the endpoints of a horizontal straight line passing through this point intersects the shape ?
if atow , which has X and Y values of 200 and 60000. If a horizontal straight line is drawn to pass through this point , it will intersect the polygon at the points 165.5 and 220.

the values 172.543 and 255.8 ? are the endpoints if x and y values 245 and 87000




in my case the atow point changes frequently based on calculation in another workbook and once the extreme edges (endpoints) are determined they should appear on another workbook.

Mr. Hui gave me the right formula for static x,y point (245,87000) now if this point location changes (anywhere inside the polygon) need to determines the endpoints automatically. this this possible

hope this clear as my English fluency is limited.
 
Thanx Narayan, That is what he is after

He will need to replicate that logic if there are multiple shapes to intersect
 
dears,
good day
after testing your solutions many times i come to a situations where point is actually out of envelope but your formula gives it within the envelope. kindly check the attached sheet.
any suggestions....???
 

Attachments

  • polygon shape (4).xlsm
    22.9 KB · Views: 2
Dear Narayank991
good day
sorry if i have shosen wrong word
wha i meant that the formula you suggested is in some situations does not give correct answer. in my situation (something related to aviation) the result should be accurate each time. thanks in advance
 
Hi Nader ,

If you remember , in an earlier post I have asked you what exactly you were looking for , and I'll quote from there :
I am confused by what you want.

1. Given a point's value on a chart , do you wish to know whether it is inside or outside the shape formed by another chart ?

2. Given a point's value on a chart , do you wish to know where the endpoints of a horizontal straight line passing through this point intersects the shape formed by another chart ?
And your answer was , and again I'll quote :
what i mean is
2. Given a point's value on a chart , i wish to know where the endpoints of a horizontal straight line passing through this point intersects the shape ?
So now , when you say , and for a third time I'll quote :
after testing your solutions many times i come to a situations where point is actually out of envelope but your formula gives it within the envelope.
I am confused ; the formulae I had given in my uploaded file calculated the end points of a straight line passing through the designated point ; the formula was not given to decide whether the designated point was inside the polygon or outside.

As far as I can see from your uploaded file , the macro is telling you whether the point is inside the polygon or outside the polygon.

Can you now confirm what exactly you want ?

Narayan
 
Dear Narayan
my project is generating loadsheet for a given flight. in the loadsheet i have to show safe ranges for the aircfraft to fly (fwd safe limt and aft safe limit) if the point is outside the envelope or polygon i have to tell by how much it is outside the envelope and i have to disable printing functionalities untill the point is within the evelope.
 
Hi Nader ,

Is your macro not telling you whether the given point is within the polygon or not ?

What do you mean by :

i have to tell by how much it is outside the envelope

Can you give an example ? I am not able to understand what exactly you want.

Narayan
 
Dear Narayan
if the y axis value is 82000, the formula gives endpoint as 170.548 which is incorrect the correct endpoin value should be around 172.9.
 

Attachments

  • polygon_shape(1).xlsm
    23.5 KB · Views: 1
Hi Nader ,

OK , understood. Basically , the formula is not giving the correct values for the right and left edges. Let me think it over.

Narayan
 
Hi Nader ,

Can you verify whether now you get the correct results ? Please verify thoroughly.

Narayan
 

Attachments

  • polygon_shape_1.xlsm
    22.9 KB · Views: 4
Dear Narayan
thank you much works flawlessly.
one more question can i disable printing functionalitiy based on weather point within envelop or out of envelop
if it is out of envelop to disable printing functionality and enable it if point is inside the envelope.
 
Hi ,

What do you mean by disable printing functionality ? At present how are you printing ?

Check the uploaded file by moving the point within and outside the envelope.

Narayan
 

Attachments

  • polygon_shape_1.xlsm
    24.1 KB · Views: 3
Back
Top