Jump to content

I have a new Idea ...


Recommended Posts

try to think of the Screen of a Computer with resolution of N x M in pixel

.. as a Matrix of size n x m

 

so i was thinking about a way to work on a matrix using iterators, and a recursive factorization function for the diagonal ...

 

if we use a pattern/series/stream iterators, but we want to make a unique representation

 

but what if we use mathematics to solve this problem, and exactly i mean Linear Algebra

 

try to think of the screen as n x m Matrix,

 

then we can have n horizontal iterators + m vertical iterators,

 

and the intersection of different iterators give us the ability to control the pattern,

 

.. also, we can try using diagonal-point recursive factor function

 

example:

| a b c |
| d e f |
| g h i |

 

a 3x3 matrix, so we have 3 vertical iterators + 3 horizontal iterators denoted as:

v1 v2 v3 + h1 h2 h3

and we have the diagonal-point recursive factor function is DPF-function(..)

 

a = f(v1,h1) b = f(v2,h1) c = f(v3,h1)

d = f(v1,h2) e = f(v2,h2) f = f(v3,h2)

g = f(v1,h3) h = f(v2,h3) i = f(v3,h3)

 

void f( int Vx, int Hy)
{
    Current.color = Current.getColor() + Vx() + Hy() ;

    if( Vx.X() == Hy.Y() )
         DPF-Function( Vx.X(), Hy.Y() );
}

 

what do you think ..?

Link to comment
Share on other sites

1. the screen consist of PIXELS

 

2. consider screen as a matrix of m x n where each element is a PIXEL

 

3. in RGB color system, each PIXEL have a value consist of three components

... Red+Green+Blue where each component have a value from 0 to 255

 

MATRIX screen of size m x n:

| P1,1  P1,2   ....  P1,n |
| P2,1  P2,2   ....  P2,n |
|  .     ...           .  |
|  .       ...         .  |
| Pm,1  Pm,2   ....  Pm,n |

 

where, m x n = the screen resolution and 0 <= Px,y < 256

 

| algorithm (given x, y, c):

|

| 1. give the element Px,1 the value c

|

| 2. for every element from Px,2 to Px,y: Px,i = Px,i-1 +0.5

|

| 3. terminate

 

this method can create a linear gradient ...

 

now with any help from linear algebra mathematicians, we can improve general methods, to iterate through this matrix, with more unique mapping ...

 

.. waiting for replies, ideas, ...

Link to comment
Share on other sites

Really not sure what you're aiming for here, you're only defining values for a column vector and there's no apparent reason for an algorithm of that shape.

 

from i=1 to N
{
P[i] :=  1/2*i + c mod 256
};

Would be easier.

Or, for a single gradient.

s := floor(N/256)

from i=1 to N
{
P[i] :=  i*s
}

Although it'd help to have any idea whatsoever of what you're trying to do.

Link to comment
Share on other sites

this method can create a linear gradient ...

 

now with any help from linear algebra mathematicians, we can improve general methods, to iterate through this matrix, with more unique mapping ...

 

I don't think you can do it simpler than

for i=0:N
for j=0:M
...

 

which is the general method for iterating through a matrix.

Link to comment
Share on other sites

  • 1 month later...

@hobz

 

im not expecting less iterations,

 

i am asking for a way to create a system for vectors,

the space is in [math]\mathbb{R}^2[/math],

can be then represented as a Matrix ...

 

i want to learn more about how can vectors help me maintaining

the matrix for example to do transformations, and renderring

objects in the 2D display ...

Link to comment
Share on other sites

Matrices are something more specific than two dimensional arrays of numbers, though two dimensional arrays of numbers can be treated as matrices if you really want.

 

Most simply, image data would be stored as each position vector (or set of Cartesian co-ordinates) being associated with one piece of colour data. (that what you'd call a bitmap).

 

Transformations can then be performed on those position vectors (as per Arnold's cat) or on the colour data describing them.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.