Flutter Engine
The Flutter Engine
SkMatrix22.h
Go to the documentation of this file.
1/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkMatrix22_DEFINED
9#define SkMatrix22_DEFINED
10
12
13class SkMatrix;
14
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]
18 *
19 * This is equivalent to
20 *
21 * SkScalar r = h.length();
22 * SkScalar r_inv = r ? SkScalarInvert(r) : 0;
23 * h.scale(r_inv);
24 * G->setSinCos(-h.fY, h.fX);
25 *
26 * but has better numerical stability by using (partial) hypot,
27 * and saves a multiply by not computing r.
28 */
30
31#endif
void SkComputeGivensRotation(const SkVector &h, SkMatrix *G)
Definition: SkMatrix22.cpp:14
SkScalar h
Definition: SkMD5.cpp:125