Points inside a rhombus in 3-dimensional sapce

  • Thread starter Thread starter rbwang1225
  • Start date Start date
  • Tags Tags
    Points
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.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
I'm interested to know whether the equation $$1 = 2 - \frac{1}{2 - \frac{1}{2 - \cdots}}$$ is true or not. It can be shown easily that if the continued fraction converges, it cannot converge to anything else than 1. It seems that if the continued fraction converges, the convergence is very slow. The apparent slowness of the convergence makes it difficult to estimate the presence of true convergence numerically. At the moment I don't know whether this converges or not.
Back
Top