Skip to main content
added 130 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

converts this to char, because the final result will be a char matrix. Character 0 is displayed as space, and the non-zerononzero entries will be written with the appropriate letters.

reads the input letter, adds 7 to its ASCII code, and negates the result. For input 'a' whisthis gives −104, which is a multiple of 26, so circularly shifting by this amount will do nothing. If the input is b this gives −105, which shifts the string 1 step to the left to produce 'bcd···yza'; etc.

The next step is to define the order in which the shifted string will be written into the nozero positionsnonzero entries of the matrix. To this end,

subtracts 7 from the latter, brings the former to top, substracts 4 from it, and negates it. The 7 and 4 specify an origin of coordinates, so that the angles of the position vectors of the non-zerononzero entries with respect to that origin define the desired order.

computes the two-argument arctangent modulo 2*pi to produce those angles. Now the smallest angle, which is zero0, corresponds to the entry where the first letter should go, and the rest advance counter-clockwise.

rearranges the letters in the string according to those angles, so that when the letters are written into the non-zerononzero entries of the matrix in column-major order (down, then across) the result will be correct. This is done by

so that 'u' will correctly go to the first (in column-major order) non-zerononzero entry, which is entry (3,1) in matrix notation; 't' will go to (4,1), 's' to (5,1); 'v' to (2,2) etc.:

 ······ v· ·· u · t · s · ·· ·· ······ 

converts this to char, because the final result will be a char matrix. Character 0 is displayed as space, and the non-zero entries will be written with the appropriate letters.

reads the input letter, adds 7 to its ASCII code, and negates the result. For input 'a' whis gives −104, which is a multiple of 26, so circularly shifting by this amount will do nothing. If the input is b this gives −105, which shifts the string 1 step to the left to produce 'bcd···yza'; etc.

The next step is to define the order in which the shifted string will be written into the nozero positions of the matrix. To this end,

subtracts 7 from the latter, brings the former to top, substracts 4 from it, and negates it. The 7 and 4 specify an origin of coordinates, so that the angles of the position vectors of the non-zero entries with respect to that origin define the desired order.

computes the two-argument arctangent modulo 2*pi to produce those angles. Now the smallest angle, which is zero, corresponds to the entry where the first letter should go, and the rest advance counter-clockwise.

rearranges the letters in the string according to those angles, so that when the letters are written into the non-zero entries of the matrix in column-major order (down, then across) the result will be correct. This is done by

so that 'u' will correctly go to the first (in column-major order) non-zero entry, which is entry (3,1) in matrix notation; 't' will go to (4,1), 's' to (5,1); 'v' to (2,2) etc.

converts this to char, because the final result will be a char matrix. Character 0 is displayed as space, and the nonzero entries will be written with the appropriate letters.

reads the input letter, adds 7 to its ASCII code, and negates the result. For input 'a' this gives −104, which is a multiple of 26, so circularly shifting by this amount will do nothing. If the input is b this gives −105, which shifts the string 1 step to the left to produce 'bcd···yza'; etc.

The next step is to define the order in which the shifted string will be written into the nonzero entries of the matrix. To this end,

subtracts 7 from the latter, brings the former to top, substracts 4 from it, and negates it. The 7 and 4 specify an origin of coordinates, so that the angles of the position vectors of the nonzero entries with respect to that origin define the desired order.

computes the two-argument arctangent modulo 2*pi to produce those angles. Now the smallest angle, which is 0, corresponds to the entry where the first letter should go, and the rest advance counter-clockwise.

rearranges the letters in the string according to those angles, so that when the letters are written into the nonzero entries of the matrix in column-major order (down, then across) the result will be correct. This is done by

so that 'u' will correctly go to the first (in column-major order) nonzero entry, which is (3,1) in matrix notation; 't' will go to (4,1), 's' to (5,1); 'v' to (2,2) etc:

 ······ v· ·· u · t · s · ·· ·· ······ 
added 2177 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

Try it online!:

converts this to char, because the final result will be a char matrix. Character 0 is displayed as space, and the non-zero entries will be written with the appropriate letters.

alters the order ofrearranges the letters in the string according to those angles, so that when the letters are written into the non-zero entries of the matrix in column-major order (down, then across), which the result will be correct. This is done by

yg( 

For example, if the input is 'a' the string was not circularly shifted:

abcdefghijklmnopqrstuvwxyz 

The rearranging as per the resultangles transforms this into

utsvrwqxpyoznamblckdjeifgh 

so that 'u' will be correctcorrectly go to the first (in column-major order) non-zero entry, which is entry (3,1) in matrix notation; 't' will go to (4,1), 's' to (5,1); 'v' to (2,2) etc.

Try it online!:

converts this to char, because the final result will be a char matrix.

alters the order of the letters in the string according to those angles, so that when the letters are written into the non-zero entries of the matrix in column-major order (down, then across), which is done by

yg( 

the result will be correct.

Try it online!

converts this to char, because the final result will be a char matrix. Character 0 is displayed as space, and the non-zero entries will be written with the appropriate letters.

rearranges the letters in the string according to those angles, so that when the letters are written into the non-zero entries of the matrix in column-major order (down, then across) the result will be correct. This is done by

yg( 

For example, if the input is 'a' the string was not circularly shifted:

abcdefghijklmnopqrstuvwxyz 

The rearranging as per the angles transforms this into

utsvrwqxpyoznamblckdjeifgh 

so that 'u' will correctly go to the first (in column-major order) non-zero entry, which is entry (3,1) in matrix notation; 't' will go to (4,1), 's' to (5,1); 'v' to (2,2) etc.

added 2177 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

which is the top left quadrant of a matrix specfying the positions of the letters. Then

reflects the matrixthat quadrant vertically without repeating the last row, and horizontally repeating the last column to produce the full matrix:

converts themthis to char, because the final result will be a char matrix. Then

reads the input letter, adds 7 to its ASCII code, and negates the result. For input 'a' whis gives -104−104, which is a multiple of 26, so circularly shifting by this amount will do nothing. If the input is b this gives -105−105, which shifts the string 1 step to the left to giveproduce 'bcd···yza'; etc.

subtracts 7 from the latter, brings the secondformer to top, substracts 4 from it, and negates it. The 7 and 4 specify an origin of coordinates, so that the angles of the position vectors of the non-zero entries with respect to that origin define the desired order.

computes the two-argument arctangent modjulomodulo 2*pi to produce those angles. Now the smallest angle, which is zero, corresponds to the entry where the first letter should go, and the rest advance counter-clockwise.

which is the top left quadrant of a matrix specfying the positions of the letters. Then

reflects the matrix vertically without repeating the last row, and horizontally repeating the last column:

converts them to char. Then

reads the input letter, adds 7 to its ASCII code, and negates the result. For input 'a' whis gives -104, which is a multiple of 26, so circularly shifting by this amount will do nothing. If the input is b this gives -105, which shifts the string 1 step the left to give 'bcd···yza'; etc.

subtracts 7 from the latter, brings the second to top, substracts 4 from it, and negates it. The 7 and 4 specify an origin of coordinates, so that the angles of the position vectors with respect to that origin define the desired order.

computes the two-argument arctangent modjulo 2*pi to produce those angles. Now the smallest angle, which is zero, corresponds to the entry where the first letter should go, and the rest advance counter-clockwise.

which is the top left quadrant of a matrix specfying the positions of the letters.

reflects that quadrant vertically without repeating the last row, and horizontally repeating the last column to produce the full matrix:

converts this to char, because the final result will be a char matrix.

reads the input letter, adds 7 to its ASCII code, and negates the result. For input 'a' whis gives −104, which is a multiple of 26, so circularly shifting by this amount will do nothing. If the input is b this gives −105, which shifts the string 1 step to the left to produce 'bcd···yza'; etc.

subtracts 7 from the latter, brings the former to top, substracts 4 from it, and negates it. The 7 and 4 specify an origin of coordinates, so that the angles of the position vectors of the non-zero entries with respect to that origin define the desired order.

computes the two-argument arctangent modulo 2*pi to produce those angles. Now the smallest angle, which is zero, corresponds to the entry where the first letter should go, and the rest advance counter-clockwise.

added 2177 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading
edited body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading