+ Reply to Thread
Results 1 to 4 of 4

Determine cornertype based on xy values

  1. #1
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Question Determine cornertype based on xy values

    Hello everyone,

    I am trying to use excel for a geometrical automated calculation.
    One of the steps that is needed in my calculation is to determine the type of corner. (Inner corner or outer corner)
    The X and Y vaues are stored in an chronological list. Each datapoint got a separate column and X and Y values are split up in 2 rows.

    I have a dilemma here, and I don't know if excel can handle this in an easy way:
    innerouter.png

    Let's assume you have three datapoints oriënted in the following way for both an inner (redand an outer corner:
    x1 < x2 < x3
    y1 > y2 > y3
    (see above image)

    In that case the location of the points by themselves are not enough to determine the type of corner.
    So I assume I need to draw an imaginary line between point 1 and 3 (white line), in other words: is there a formula to make a function outof data point 1 + 3 and tell if datapoint 2 is left or right from this function?

    Or maybe you have another solution?

    Thank you very much for looking into this!
    Last edited by Solvax; 07-06-2018 at 12:28 PM.

  2. #2
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Re: Determine cornertype based on xy values

    I cannot edit my post without rewriting everything..

    So therefore just a small correction by reply:
    The sentence under the picture should be:
    Let's assume you have three datapoints oriënted in the following way for both an inner (red) and an outer corner (blue):

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,848

    Re: Determine cornertype based on xy values

    I don't know how much of this is "easy".

    My first thought, looking at your drawing, is that for an inner corner, the slope [(y2-y1)/(x2-x1)] for the first segment is closer to 0 than the second segment [(y3-y2)/(x3-x2)]. Opposite scenario for an outer corner. If that is true, then a simple sequence of calculations (slope of segment 1, slope of segment 2, compare slopes to see which is closer to 0 and return outer/inner) should be all that is needed.

    The approach you are proposing seems like it should be easy enough to program in. Use linear interpolation [(y3-y1)/(x3-x1)=(y2-y1)/(x4-x1)] to solve for x4 (the x coordinate of the point along the white line that is directly across from y2). If x4 is less than x2, then you have an outer corner. If x4 is greater than x2, then you have an inner corner.

    I expect that some trig could be brought in to determine the result (is the angle at point 2 a negative/clockwise angle or positive/counter-clockwise).

    What difficulties do you run into implementing any of those?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Re: Determine cornertype based on xy values

    Thank you very much for your help MrShorty
    I managed to solve it also thanks to your approach.

    I make a linear function outof points 1 and 2 and also 1 and 3 and by the difference in slope I can then determine where point 2 is located in relation to 1 and 3.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Determine values based on several constraints
    By keis386 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-23-2015, 05:18 PM
  2. Replies: 10
    Last Post: 11-19-2014, 11:26 AM
  3. determine value based on range of sub values
    By shayma in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-14-2014, 12:01 PM
  4. How to determine values based on a previous cell
    By Kastalarial in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2013, 06:26 AM
  5. [SOLVED] determine a rate from a range of values based on a weekly fuel price
    By djgoody9 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-29-2013, 12:48 PM
  6. Replies: 4
    Last Post: 05-29-2013, 04:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1