Points inside a rhombus in 3-dimensional sapce

  • Context: Graduate 
  • Thread starter Thread starter rbwang1225
  • Start date Start date
  • Tags Tags
    Points
Click For Summary
SUMMARY

This discussion focuses on determining whether points are inside a rhombus in 3-dimensional space using the coordinates of its vertices. The proposed method involves calculating edge vectors from each vertex and expressing test points as linear combinations of these vectors. If the coefficients of these combinations are non-negative for all vertices, the point lies within or on the edge of the rhombus. An alternative method involves testing the position of points relative to the edges of the rhombus, though it is noted that this approach may introduce errors more easily.

PREREQUISITES
  • Understanding of 3D coordinate systems
  • Familiarity with vector mathematics
  • Basic knowledge of linear combinations
  • Concept of geometric boundaries in multi-dimensional spaces
NEXT STEPS
  • Research vector representation in 3D geometry
  • Learn about linear combinations and their applications in geometry
  • Explore algorithms for point-in-polygon tests in higher dimensions
  • Investigate error handling in geometric computations
USEFUL FOR

Mathematicians, computer graphics developers, and anyone involved in computational geometry or 3D modeling who needs to determine point inclusion within defined geometric boundaries.

rbwang1225
Messages
112
Reaction score
0
I have a lattice plane in 3 dimensional space.
Now, I want to cut it in a unit cell, but I have to write some code the make things get easier.
As you can see from my figure, I can know the four coordinates of the highlighted atoms which form the boundaries of the top plane.
My problem is if the four coordinates are known, how could I eliminate the atoms outside the boundary, or how could I know the limitations of the coordinates ##(x_i,y_i,z_i)## of atoms inside the boundary.

My idea is to use their slopes between each pair of highlighted atoms.

Any advices would be very appreciated!
 
Mathematics news on Phys.org
rbwang1225 said:
As you can see from my figure,
What figure?
 
rbwang1225 said:
if the four coordinates are known, how could I eliminate the atoms outside the boundary

This seems like a simple easy to understand method.

For each point p which you want to test to determine if it is inside the rhombus,
For each of the four verticies v making up your rhombus,
You have two edge vectors from v, call those vector1 and vector 2.
Express your point p as the unique p=const1*vector1+const2*vector2.
If const1 and const2 are greater than or equal to zero then the point lies within on on the edge of the rhombus, at least as far as that vertex v is concerned.
Think a few minutes until you can convince yourself why that is true.
If you repeat this for all four verticies and they all agree it is in or on the edge then that point p is inside your rhombus.
Repeat for all other points.

There is also a method that tests which side of a line a point lies on. If you use each edge of your rhombus as a line then that will also give the same result. But it seems easier for students to introduce a sign error somewhere when using this method than when using the previous test.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K