User Profile

Collapse

Profile Sidebar

Collapse
SteveJLV
SteveJLV
Last Activity: May 12 '16, 04:37 PM
Joined: Oct 23 '15
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • figured it out. I realized that the points shift through the cycle in a specific way. It's easier to see when you put them in rows
    [A B C D]
    [B A D C]
    [C D A B]
    [D C B A] A and C shift from left to right and B and D shift one place to the left. When they fall off (left or right) they continue on the other side. So the new code looks like:
    Code:
    polypoints = [(33, 24), (0, 20), (32, 13), (28, 15)]
    temppoints = [0,0,0,0]
    ...
    See more | Go to post

    Leave a comment:


  • Thanks! The C[0] should be C[1] but that's not an issue. I' ll try to explain the why and when. As said the ABCD are points of a polygone in 2Dimensions. And I know that lines AB and CD do not cross and AC does not cross BD, I have a function in my program that takes a list with the polygons points in a specific order first the point with the lowest y - value, i.e. the bottom corner of my polygon the next two points of my list need to be the "...
    See more | Go to post

    Leave a comment:


  • Dear dwblas, I do not want to sort the rest from the smallest to the largest. Please read the question I tried to make it clear, the sequence depends only on the el ement with the smallest value for one of its elements.
    See more | Go to post

    Leave a comment:


  • The points in the list are the corners of a polygone, I am not looking to sort the points, just find the point with the smallest Y value and than arrange the points depending on which point has the smallest value. I put some code which ilustrates the idea.
    See more | Go to post

    Leave a comment:


  • order a list depending on result of first ordered item.

    Hello, My problem is to order a list (in my case 4 items) [A,B,C,D] all items are tuples i.e.(value1, value2)
    we are looking for the element with the smallest value1.
    This element has to become the first element in the ordered list, the rest of the list has to be one of the folowing :
    [A, B, C, D] or[B, A, D, C] or[C, D, A, B]or[D, C, B, A]
    So when C[0] had the smallest value1 the returned list should be in the order [C,...
    See more | Go to post
No activity results to display
Show More
Working...