Shear Transformation
Hi guys, any ideas to calculate new value of length image after shear transformation ? thanks
add a comment
Hi guys, any ideas to calculate new value of length image after shear transformation ? thanks
Here is the code to apply a shear transformation (https://en.wikipedia.org/wiki/Shear_m...):
double shear = -3;
vector_3 vertex0(-0.5, 0.5, 0); // v0 v3
vector_3 vertex1(-0.5, -0.5, 0); //
vector_3 vertex2( 0.5, -0.5, 0); //
vector_3 vertex3( 0.5, 0.5, 0); // v1 v2
vertex0.x = vertex0.x + shear*vertex0.y;
vertex1.x = vertex1.x + shear*vertex1.y;
vertex2.x = vertex2.x + shear*vertex2.y;
vertex3.x = vertex3.x + shear*vertex3.y;
double width = 0;
if(shear < 0)
width = vertex2.x - vertex0.x;
else
width = vertex3.x - vertex1.x;
// when using a unit square,
// like we do here,
// width == abs(shear) + 1
cout << width << endl;
Asked: 2018-06-02 09:56:30 -0600
Seen: 562 times
Last updated: Jun 03 '18