cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to rotate image without using "rotate" keyword in mathcad?

Mathcad111
11-Garnet

How to rotate image without using "rotate" keyword in mathcad?

Example: A=(0,1,2) now by using rotate keyword Result = rotate(A,180); Result = (2,1,0). But how to do this without keyword ?

 

11 REPLIES 11

May be this help you

TT.png

yes i'm aware of that but how to do for random degrees for ex:  rotate(A,41) or rotate(A,33)?

"rotate" is used to rotate a picture(matrix) by a given angle in degree with some sort of antialiasing.

Why would you like to program that function yourself and not use the built-in one?

B.png

 

Yes i'm aware of that keyword but how to do without keyword ? or is it possible to see how that "rotate" function program has written in mathcad ? 


@Mathcad111 wrote:

Yes i'm aware of that keyword but how to do without keyword ?


You haven't answered my question which simply was: WHY?

 


@Mathcad111 wrote:

or is it possible to see how that "rotate" function program has written in mathcad ? 


No, not that I would be aware of. The algorithms used in Mathcad are not a secret but are hard coded and so can't not be inspected unless you have access to the source code of the program.

As far as I am aware many algorithms implemented in Mathcad followed the "Numerical Recipes" and the four volumes of "Knuth - The Art of Computer Programming" but I am not sure if this also applies to the algorithms for manipulating bitmaps.

 

But if you study Books about computer graphics you sure will find various ways and algorithms how to rotate a bitmap picture and implement anti-aliasing.

Searching the net will reveal a lot of possible implementations, too. Some less, some more elaborate.

As one example you may ave a look at https://www.codeproject.com/Articles/12230/Anti-Aliased-Image-Rotation

1. yes got that as you said  it's complicated (code)

2. "Yes i'm aware of that keyword but how to do without keyword ?" because it's my task which i have to complete i found it's bit difficult but i refer this post "https://community.ptc.com/t5/PTC-Mathcad/How-to-rotate-matrix-around-specific-index/td-p/29535" but still i could not make it! 

The part which rotates the image/matrix is not complicated at all as you can see in my little program "Rotate" in the thread you have linked to. basically its simply a multiplication with a standard 2 x 2 rotation matrix. The routine was written to fit the data structure provided by the original poster and does not work (unchanged) on a picture matrix as the built-in "rotate" command. Furthermore no anti aliasing was implemented which could be the harder part if this is what you are looking for.

ok understand! is it possible to do without "anti aliasing" just can we rotate the image?


@Mathcad111 wrote:

ok understand! is it possible to do without "anti aliasing" just can we rotate the image?


Sure. I showed in the thread you linked to how this could be done.

krogerfeedback


@Mathcad111 wrote:

Example: A=(0,1,2) now by using rotate keyword Result = rotate(A,180); Result = (2,1,0). But how to do this without keyword ?

 


I didn't exactly understand this? Am I missing something?

LucMeekes
23-Emerald III
(To:Reign623)

The OP didn't want to know the result of rotating, but wanted insight in the algorithm of how to do it.

 

Luc

Top Tags