Click here to Skip to main content
15,913,722 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dialog toolbar and Controls toolbar Pin
Michael P Butler11-Jan-02 5:17
Michael P Butler11-Jan-02 5:17 
GeneralExtendable Dialog Box Pin
11-Jan-02 4:47
suss11-Jan-02 4:47 
GeneralRe: Extendable Dialog Box Pin
User 665811-Jan-02 5:25
User 665811-Jan-02 5:25 
GeneralRe: Extendable Dialog Box Pin
Ernest Laurentin11-Jan-02 5:37
Ernest Laurentin11-Jan-02 5:37 
GeneralRe: Extendable Dialog Box Pin
Nish Nishant11-Jan-02 13:45
sitebuilderNish Nishant11-Jan-02 13:45 
GeneralAdding sound events Pin
11-Jan-02 4:24
suss11-Jan-02 4:24 
GeneralMathematical Shearing Pin
Alan Chambers11-Jan-02 4:16
Alan Chambers11-Jan-02 4:16 
GeneralRe: Mathematical Shearing Pin
Joaquín M López Muñoz11-Jan-02 5:21
Joaquín M López Muñoz11-Jan-02 5:21 
If I'm understanding correctly your request, shearing, as well as shrinking, strechting and rotating are linear transformations. If you combine a linear transformation with an offset, you have an affine transformation. An affine transformation is given by six parameters which we'll call a11,a12,a21,a22,b1 and b2, so that points with coordinates (x,y) are transformed to coordinates (x',y') given by:

x' = a11*x + a12*y + b1,
y' = a21*x + a22*y + b2.

This is trivially implemented in C++, the problem remaining is how to identify the six parameters for a given transformation. In the general case you take three points and their corresponding transformed points and plug the coordinates into these equations, giving you six equations and six variables that you can solve manually or with your favorite maths package. In the particular case of a horizontal shear, we have

a21=0,
a22=1,
b2=0,

so you nedd only two points to solve the remainig parameters.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Mathematical Shearing Pin
Alan Chambers11-Jan-02 8:47
Alan Chambers11-Jan-02 8:47 
GeneralRe: Mathematical Shearing Pin
Joaquín M López Muñoz12-Jan-02 6:53
Joaquín M López Muñoz12-Jan-02 6:53 
GeneralSTLport Pin
Senkwe Chanda11-Jan-02 3:55
Senkwe Chanda11-Jan-02 3:55 
GeneralRe: STLport Pin
Christian Graus11-Jan-02 10:25
protectorChristian Graus11-Jan-02 10:25 
GeneralA Real Rectangle for Print! Pin
Eugene Pustovoyt11-Jan-02 2:10
Eugene Pustovoyt11-Jan-02 2:10 
GeneralControl works properly in VB, but not in VC++ Pin
sanskypotov11-Jan-02 0:47
sanskypotov11-Jan-02 0:47 
GeneralRe: Control works properly in VB, but not in VC++ Pin
Bill Wilson11-Jan-02 6:55
Bill Wilson11-Jan-02 6:55 
GeneralWriting to file Pin
patty11-Jan-02 0:38
patty11-Jan-02 0:38 
GeneralRe: Writing to file Pin
Christian Graus11-Jan-02 1:11
protectorChristian Graus11-Jan-02 1:11 
GeneralRe: Writing to file Pin
Roger Allen11-Jan-02 3:07
Roger Allen11-Jan-02 3:07 
GeneralRe: Writing to file Pin
11-Jan-02 3:38
suss11-Jan-02 3:38 
GeneralRe: Writing to file Pin
Nish Nishant11-Jan-02 3:57
sitebuilderNish Nishant11-Jan-02 3:57 
GeneralRe: Writing to file Pin
Nish Nishant11-Jan-02 3:41
sitebuilderNish Nishant11-Jan-02 3:41 
GeneralRe: Writing to file Pin
11-Jan-02 1:57
suss11-Jan-02 1:57 
GeneralIID_IContextMenu: Open With in Windows ME/2000/XP Pin
Ana Lucia11-Jan-02 0:23
Ana Lucia11-Jan-02 0:23 
GeneralRe: IID_IContextMenu: Open With in Windows ME/2000/XP Pin
Michael Dunn11-Jan-02 7:40
sitebuilderMichael Dunn11-Jan-02 7:40 
GeneralRe: IID_IContextMenu: Open With in Windows ME/2000/XP Pin
Ana Lucia11-Jan-02 7:57
Ana Lucia11-Jan-02 7:57 

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.