Click here to Skip to main content
15,902,635 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Subset Packing problem Pin
73Zeppelin21-May-08 21:10
73Zeppelin21-May-08 21:10 
QuestionRqst links for Time Complexity Pin
Vijjuuu.19-May-08 21:19
Vijjuuu.19-May-08 21:19 
AnswerRe: Rqst links for Time Complexity Pin
73Zeppelin22-May-08 0:21
73Zeppelin22-May-08 0:21 
GeneralRe: Rqst links for Time Complexity Pin
Vijjuuu.22-May-08 3:43
Vijjuuu.22-May-08 3:43 
GeneralRe: Rqst links for Time Complexity Pin
73Zeppelin22-May-08 19:50
73Zeppelin22-May-08 19:50 
QuestionExtracting shear X&Y from 3x3 affine transformation matrix Pin
Jim Crafton19-May-08 10:27
Jim Crafton19-May-08 10:27 
AnswerRe: Extracting shear X&Y from 3x3 affine transformation matrix Pin
Anthony Mushrow19-May-08 11:08
professionalAnthony Mushrow19-May-08 11:08 
GeneralRe: Extracting shear X&Y from 3x3 affine transformation matrix Pin
Jim Crafton20-May-08 2:54
Jim Crafton20-May-08 2:54 
SK Genius wrote:
Infact, how are you getting the other values?

Good question!

Here's the code for extracting the values. Note I got this from another lib, so I'm not 100% clear on all the math - I *think* I understand the idea behind it though.

//class has a 
double matrix_[3][3];
//defined


double Matrix2D::getRotation() const
{
	//based on Maxim Shemanarev AGG matrix code ! Thanks !
	double x1 = 0.0;
	double y1 = 0.0;
	double x2 = 1.0;
	double y2 = 0.0;
	
	apply(x1, y1);
	apply(x2, y2);

	return atan2(y2-y1, x2-x1);
}


void Matrix2D::getScale( double& x, double& y ) const
{
	//based on Maxim Shemanarev AGG matrix code ! Thanks !
	double x1 = 0.0;
	double y1 = 0.0;
	double x2 = 1.0;
	double y2 = 1.0;
	Matrix2D rot;
	rot.rotate( -getRotation() );

	rot.multiply( *this );

	rot.apply(x1, y1);
	rot.apply(x2, y2);
	
	x = x2 - x1;
	y = y2 - y1;
}


note that apply() simply transforms the (x,y) values by whatever is in the matrix_ array.

¡El diablo está en mis pantalones! ¡Mire, mire!

Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!

SELECT * FROM User WHERE Clue > 0
0 rows returned

Save an Orange - Use the VCF!
VCF Blog

GeneralRe: Extracting shear X&Y from 3x3 affine transformation matrix Pin
Anthony Mushrow20-May-08 3:31
professionalAnthony Mushrow20-May-08 3:31 
AnswerRe: Extracting shear X&Y from 3x3 affine transformation matrix Pin
73Zeppelin19-May-08 19:21
73Zeppelin19-May-08 19:21 
AnswerRe: Extracting shear X&Y from 3x3 affine transformation matrix Pin
Arash Partow29-May-08 23:37
Arash Partow29-May-08 23:37 
QuestionLong and Int64 Pin
MumbleB15-May-08 20:18
MumbleB15-May-08 20:18 
AnswerRe: Long and Int64 Pin
Ed.Poore15-May-08 21:18
Ed.Poore15-May-08 21:18 
GeneralRe: Long and Int64 Pin
CPallini15-May-08 21:37
mveCPallini15-May-08 21:37 
GeneralRe: Long and Int64 Pin
Ed.Poore15-May-08 21:48
Ed.Poore15-May-08 21:48 
AnswerRe: Long and Int64 Pin
MarkB77715-May-08 21:28
MarkB77715-May-08 21:28 
AnswerRe: Long and Int64 Pin
cp987615-May-08 21:46
cp987615-May-08 21:46 
AnswerRe: Long and Int64 Pin
Mark Churchill18-May-08 4:34
Mark Churchill18-May-08 4:34 
AnswerRe: Long and Int64 Pin
PIEBALDconsult5-Jun-08 8:14
mvePIEBALDconsult5-Jun-08 8:14 
AnswerRe: Long and Int64 Pin
Tadeusz Westawic13-Jun-08 3:28
Tadeusz Westawic13-Jun-08 3:28 
QuestionCounting bricks from image Pin
asiv14-May-08 23:04
asiv14-May-08 23:04 
AnswerRe: Counting bricks from image Pin
Matthew Butler15-May-08 1:34
Matthew Butler15-May-08 1:34 
GeneralRe: Counting bricks from image Pin
asiv15-May-08 2:34
asiv15-May-08 2:34 
GeneralRe: Counting bricks from image Pin
Tim Craig15-May-08 17:31
Tim Craig15-May-08 17:31 
GeneralRe: Counting bricks from image Pin
asiv15-May-08 20:47
asiv15-May-08 20:47 

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.