public void rotate(double theta)
{
// this is the matrix to multiply by..
//x*cos(theta) , y* sin(theta)
// x* -sin(theta)
//y * cos(theta)
vertices[0][0]= vertices[0][0]* Math.cos(theta)+ Math.sin(theta)*vertices[0][1];
vertices[0][1]= vertices[0][0] * (-Math.sin(theta)) + Math.cos(theta)*vertices[0][1];
vertices[1][0]= vertices[1][0]* Math.cos(theta)+ Math.sin(theta)*vertices[1][1];
vertices[1][1]= vertices[1][0] * (-Math.sin(theta)) + Math.cos(theta)*vertices[1][1];
vertices[2][0]= vertices[2][0]* Math.cos(theta)+ Math.sin(theta)*vertices[2][1];
vertices[2][1]= vertices[2][0] * (-Math.sin(theta)) + Math.cos(theta)*vertices[2][1];
vertices[3][0]= vertices[3][0]* Math.cos(theta)+ Math.sin(theta)*vertices[3][1];
vertices[3][1]= vertices[3][0] * (-Math.sin(theta)) + Math.cos(theta)*vertices[3][1] ;
}
michael.james.90475 -3 Newbie Poster
michael.james.90475 -3 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
michael.james.90475 -3 Newbie Poster
michael.james.90475 -3 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
michael.james.90475 -3 Newbie Poster
michael.james.90475 -3 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.