General Question

HeroicZach's avatar

Is there a mathematical method that takes a matrix and generates a "diamond" of values from rotating it 45 degrees?

Asked by HeroicZach (195points) November 29th, 2010

I’m writing a program that simulates a game, and to do so I need to come up with a function that can rotate a matrix by 45 degrees, essentially. So if I have a 5 by 5 matrix, I need to generate a list of lists looking like:
5,5
4,1 5,2
3,1 4,2 5,3
etc etc all the way down to 1,5

I’m wondering how an operation like this would work…thanks!

Observing members: 0 Composing members: 0

3 Answers

Thammuz's avatar

Do you have to show this matrix to the user? Because if you don’t then you don’t need to tilt it.

LostInParadise's avatar

I am not sure what you mean by roatate 45 degrees. How does (4,1) end up next to (5,5)? If I knew what you wanted to do, I might be able to provide an alogorithm for transforming the matrix.

FireMadeFlesh's avatar

Are you talking about spatial anti-aliasing techniques?

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther