Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Ranking points in the plane

Subject: Ranking points in the plane

From: Miroslav

Date: 4 Nov, 2010 12:56:03

Message: 1 of 8

I have 4 points in the plane, I need is some sort (by angle ?), that after the merger was a square (rectangle). thanks for the reply

Subject: Ranking points in the plane

From: ImageAnalyst

Date: 4 Nov, 2010 13:17:39

Message: 2 of 8

On Nov 4, 8:56 am, "Miroslav " <mire...@gmail.com> wrote:
> I have 4 points in the plane, I need is some sort (by angle ?), that after the merger was a square (rectangle). thanks for the reply

If you have the coordinates of all 4 corners, check to make sure that
the opposite sides (top/bottom, left/right) are the same length to
some tolerance that you specify. Then measure the two diagonals and
make sure they are within some tolerance of length of each other. You
could do other checks too, such as seeing if each triplet of points is
close enough to 90 degrees for you. It just depends on how you want
to define a rectangle - how close you need to be to call your
quadrilateral a "rectangle."

Subject: Ranking points in the plane

From: Miroslav

Date: 4 Nov, 2010 13:44:04

Message: 3 of 8

I expressed badly, I need an arbitrary quadrilateral , I dont want diagonal quadrilateral ,Therefore I need ranking these points ...

Subject: Ranking points in the plane

From: Miroslav

Date: 4 Nov, 2010 13:45:05

Message: 4 of 8

I expressed badly, I need an arbitrary quadrilateral , I dont want diagonal quadrilateral ,Therefore I need ranking these points ...

Subject: Ranking points in the plane

From: ImageAnalyst

Date: 4 Nov, 2010 13:57:59

Message: 5 of 8

On Nov 4, 9:45 am, "Miroslav " <mire...@gmail.com> wrote:
> I expressed badly, I need an arbitrary quadrilateral , I dont want diagonal quadrilateral ,Therefore I need ranking these points ...
------------------------------------------------------------------------------------------------------------------------------------------------------------------

I have no idea what that means.
Do you have 4 (x,y) coordinates?
If so, how do you want to analyze them?
What does "ranking" mean in that context?

Subject: Ranking points in the plane

From: Miroslav

Date: 4 Nov, 2010 14:09:03

Message: 6 of 8

sorry for my bad english

I have coordinates in one plane
 A= [0.5000 0.5000 0.5000]
 B= [0.5000 1.0000 0.5000]
 C= [0.5000 0.5000 1.0000]
 D= [0.5000 1.0000 1.0000]

I need to sort these points ... I want draw quadrilateral without diagonals
>
> I have no idea what that means.
> Do you have 4 (x,y) coordinates?
> If so, how do you want to analyze them?
> What does "ranking" mean in that context?

Subject: Ranking points in the plane

From: ImageAnalyst

Date: 4 Nov, 2010 15:26:28

Message: 7 of 8

It looks like these are (x,y,z) triplets. It looks like x is constant
so that your points are in the y-z plane located at x=0.5. So just do
this: "Follow Walter's suggestions" so that you get the vertices going
around in one direction, for example clockwise. Then when you plot
the quad, you won't have any crossing ("diagonals") because you're
going around it in one direction (e.g. clockwise).

Subject: Ranking points in the plane

From: Roger Stafford

Date: 4 Nov, 2010 17:34:05

Message: 8 of 8

"Miroslav " <mirek.u@gmail.com> wrote in message <iauepv$cbs$1@fred.mathworks.com>...
> sorry for my bad english
>
> I have coordinates in one plane
> A= [0.5000 0.5000 0.5000]
> B= [0.5000 1.0000 0.5000]
> C= [0.5000 0.5000 1.0000]
> D= [0.5000 1.0000 1.0000]
>
> I need to sort these points ... I want draw quadrilateral without diagonals
- - - - - - - - -
  You have said "I want draw quadrilateral without diagonals." Yet any four coplanar points can be considered the four vertices of a valid quadrilateral and it can certainly be drawn without its diagonals.

  Therefore as nearly as I can make out, you must mean you want to rearrange the order of four coplanar points so they constitute a quadrilateral in which its two diagonals lie within the quadrilateral's interior - that is, the quadrilateral has a convex hull. Unfortunately that can't always be done. If one of the four points lies within the triangle formed by the other three, you can never make a convex quadrilateral out of the points no matter what order you put them in.

  I think there is need for further clarification on your part, Miroslav.

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us