2 * Copyright 2014 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkMatrix22_DEFINED
9 #define SkMatrix22_DEFINED
15 /** Find the Givens matrix G, which is the rotational matrix
16 * that rotates the vector h to the positive hoizontal axis.
17 * G * h = [hypot(h), 0]
19 * This is equivalent to
21 * SkScalar r = h.length();
22 * SkScalar r_inv = r ? SkScalarInvert(r) : 0;
24 * G->setSinCos(-h.fY, h.fX);
26 * but has better numerical stability by using (partial) hypot,
27 * and saves a multiply by not computing r.
29 void SkComputeGivensRotation(const SkVector& h, SkMatrix* G);