Click here to Skip to main content
15,888,341 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Best coding practice. Pin
Luc 64801111-Apr-09 0:39
Luc 64801111-Apr-09 0:39 
GeneralRe: Best coding practice. Pin
Member 419459311-Apr-09 5:51
Member 419459311-Apr-09 5:51 
GeneralRe: Best coding practice. Pin
Luc 64801111-Apr-09 6:18
Luc 64801111-Apr-09 6:18 
GeneralRe: Best coding practice. Pin
Member 419459315-Apr-09 8:29
Member 419459315-Apr-09 8:29 
GeneralRe: Best coding practice. Pin
Luc 64801115-Apr-09 8:39
Luc 64801115-Apr-09 8:39 
GeneralRe: Best coding practice. Pin
Member 419459315-Apr-09 9:45
Member 419459315-Apr-09 9:45 
QuestionRotation of Bitmap Pin
CodeOfLife5-Apr-09 16:21
CodeOfLife5-Apr-09 16:21 
AnswerRe: Rotation of Bitmap [modified] Pin
Luc Pattyn5-Apr-09 16:30
sitebuilderLuc Pattyn5-Apr-09 16:30 
Hi,

without a method that offers free rotation, you would have to do it yourself, along these lines:

foreach row y2 in destination image
    foreach column x2 in destination image
        calculate corresponding location (x1,y1) in source image
        copy from source image at (x1,y1) to destination image (x2,y2)
    }
}


without translation, the rotation formulas would be something like
x1 = x2 * cosa - y2 * sina
y1 = x2 * sina + y2 * cosa

[EDIT: fixed a typo /]

where cosa and sina are the (constant) cosine and sine of the rotation angle.

You would need to add some constant to x1 and y1 to choose the center of rotation.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


modified on Monday, April 6, 2009 11:25 AM

GeneralRe: Rotation of Bitmap Pin
CodeOfLife6-Apr-09 6:37
CodeOfLife6-Apr-09 6:37 
GeneralRe: Rotation of Bitmap Pin
Luc Pattyn6-Apr-09 6:59
sitebuilderLuc Pattyn6-Apr-09 6:59 
QuestionCreating RSOM from SOM Pin
Jasmine Pomelo4-Apr-09 14:04
Jasmine Pomelo4-Apr-09 14:04 
QuestionRe: Creating RSOM from SOM Pin
CPallini6-Apr-09 21:39
mveCPallini6-Apr-09 21:39 
AnswerRe: Creating RSOM from SOM Pin
Jasmine Pomelo9-Apr-09 9:38
Jasmine Pomelo9-Apr-09 9:38 
QuestionSingle Elimination - Tournament Brackets Pin
aslamc2-Apr-09 9:32
aslamc2-Apr-09 9:32 
AnswerRe: Single Elimination - Tournament Brackets Pin
Alan Balkany3-Apr-09 4:00
Alan Balkany3-Apr-09 4:00 
QuestionTree algo Pin
dfreeser2-Apr-09 5:58
dfreeser2-Apr-09 5:58 
AnswerRe: Tree algo Pin
Alan Balkany3-Apr-09 3:43
Alan Balkany3-Apr-09 3:43 
GeneralRe: Tree algo Pin
dfreeser3-Apr-09 5:15
dfreeser3-Apr-09 5:15 
GeneralRe: Tree algo Pin
Alan Balkany3-Apr-09 5:42
Alan Balkany3-Apr-09 5:42 
GeneralRe: Tree algo Pin
dfreeser3-Apr-09 6:02
dfreeser3-Apr-09 6:02 
GeneralRe: Tree algo Pin
Alan Balkany3-Apr-09 6:16
Alan Balkany3-Apr-09 6:16 
GeneralRe: Tree algo Pin
dfreeser3-Apr-09 6:33
dfreeser3-Apr-09 6:33 
Questioncalculate polygon area and its centre in 3d Pin
beko31-Mar-09 22:57
beko31-Mar-09 22:57 
AnswerRe: calculate polygon area and its centre in 3d Pin
Alan Balkany1-Apr-09 3:46
Alan Balkany1-Apr-09 3:46 
GeneralRe: calculate polygon area and its centre in 3d Pin
beko1-Apr-09 19:26
beko1-Apr-09 19:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.