Taking a slice of a two dimensional array

  • Thread starter Thread starter jing2178
  • Start date Start date
  • Tags Tags
    Array
jing2178
Messages
41
Reaction score
2
The source of this question is an unanswered question at stackoverflow but I believe is more mathematical than computational.

My question arising from this is.

You have a two dimensional array of numbers, each element of the array is represented by a square box. The boxes arranged into a rectangle with element (i,j) represented by the box in position (i,j). A 1-dimensional slice of the array is formed by drawing a line across the boxes, choosing boxes based on the position of the line crossing them and a vector formed on the basis of the chosen boxes.

This pdf file shows an issue arising following one attempt to do this.

Are there already recognised ways of doing this?
Are there better ways of doing this than the way I have tried?
Can the question be stated in a more succinct way?

Any help please.
 
Mathematics news on Phys.org
All 3 methods are possible - and you could take alternating lower/upper pixel as well if "combined pixel" is not practical for some reason.
To make things even more complicated: The cell right of 2 is not hit in the center - you could try to take that into account as well.

Which method is best for you depends on the application.
 
NemoReally said:

Thank you that is useful. As it is still a 2D representation of the line I think I will need to look at the projection of the line (and hence pixels) on boundary lines parallel to the axes.
 
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...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...

Similar threads

Replies
21
Views
3K
Replies
2
Views
2K
Replies
3
Views
3K
Replies
3
Views
6K
Replies
14
Views
5K
Back
Top