/* Helper function that, given a set of angles, constructs the appropriate * skew matrix. */ static void ProcessSkewHelper(double aXAngle, double aYAngle, float aMain[4]) { /* We want our matrix to look like this: * | 1 tan(ThetaX) 0| * | tan(ThetaY) 1 0| * | 0 0 1| * However, to avoid infinite values, we'll use the SafeTangent function * instead of the C standard tan function. */ aMain[2] = SafeTangent(aXAngle); aMain[1] = SafeTangent(aYAngle); }
/* Helper function that, given a set of angles, constructs the appropriate * skew matrix. */ /* static */ gfx3DMatrix nsStyleTransformMatrix::ProcessSkewHelper(double aXAngle, double aYAngle) { /* We want our matrix to look like this: * | 1 tan(ThetaY) 0 0 | * | tan(ThetaX) 1 0 0 | * | 0 0 1 0 | * | 0 0 0 1 | * However, to avoid infinite values, we'll use the SafeTangent function * instead of the C standard tan function. */ gfx3DMatrix temp; temp._12 = SafeTangent(aYAngle); temp._21 = SafeTangent(aXAngle); return temp; }
void Matrix4x4::SkewXY(double aXSkew, double aYSkew) { // XXX Is double precision really necessary here float tanX = SafeTangent(aXSkew); float tanY = SafeTangent(aYSkew); float temp; temp = _11; _11 += tanY * _21; _21 += tanX * temp; temp = _12; _12 += tanY * _22; _22 += tanX * temp; temp = _13; _13 += tanY * _23; _23 += tanX * temp; temp = _14; _14 += tanY * _24; _24 += tanX * temp; }