Coordinate System: Place N Elements in a Square Format

  • Thread starter Thread starter bobby_kl
  • Start date Start date
  • Tags Tags
    System
AI Thread Summary
To place n elements in a square format within a coordinate system, the distance between consecutive points can be defined as r. For odd n, the coordinates are generated using the formula (ir, jr) where i and j range from -k to k, with k being (m-1)/2 and m being the square root of n. For even n, the coordinates take the form ((i+1/2)r, (j+1/2)r) for i and j ranging from 1 to k, where m equals 2k. The discussion provides algorithms for plotting these points based on whether n is odd or even. This approach allows for systematic placement of elements in a square layout.
bobby_kl
Messages
1
Reaction score
0
Hello,

In a co-ordinate system i have to place some n elements in a square format as shown in fig. with a distance r. Instead of manually doing i would like to derive by equations, for x and y positions. The no. of elements may be 4 or 9 or 16 or 25 etc.. Can anyone help me..

thanks in advance
 

Attachments

  • 4.jpg
    4.jpg
    1.3 KB · Views: 436
  • 9.jpg
    9.jpg
    1.4 KB · Views: 479
Mathematics news on Phys.org
"In a co-ordinate system i have to place some n elements in a square format as shown in fig. with a distance r. "

Distance between two consecutive points horizontally and vertically r or distance to nearest neighbor r? (I'm going to assume "horizontally and vertically". If you meant straight line distance r, take my r to be your r divided by sqrt(2).)

You probably realized, since you have two pictures, that the problems breaks down into two cases: number of elements odd or even.
In either case, let m= sqrt(n) (by the conditions of the problem, m is also an integer.)

If n, number of elements is odd, m is also odd: let k= (m-1)/2 (so that m= 2k+1)Then there exist a point at the origin (0,0). Every point has coordinates (ir, jr) where i and j run from -k to k by integers (including 0, of course). An algorithm to plot them might be

For (integer)i= -k to k, step 1
{
For (integer j= -k to k, step 1
{
plot(i*r,j*r);
}
}
For example, if n= 9, then m= 3 and k= 1. The 9 points would have coordinates
(-r,-r), (0,-r),(r,-r), (0,-r), (0,0), (0,r), (r,-r), (r,0), and (r,r).

if n is even, then m is also even and m= 2k for some integer k. Now all points are of the form ((i+1/2)r, (j+1/2)r) for i= 1 to k and i= -1 to -k (skipping over 0). An algorithm to plot them (but not in the same order as above) might be:
For (integer)i= 1 to k, step 1
{
For (integer)j= 1 to k, step 1
{
plot((i+1/2)r,(j+1/2)r)
plot((-i-1/2)r,(-j-1/2)r)
}
}
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
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...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top