Flutter Engine
The Flutter Engine
|
#include "src/utils/SkMatrix22.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPoint.h"
#include "include/core/SkScalar.h"
Go to the source code of this file.
Functions | |
void | SkComputeGivensRotation (const SkVector &h, SkMatrix *G) |
Find the Givens matrix G, which is the rotational matrix that rotates the vector h to the positive hoizontal axis. G * h = [hypot(h), 0]
This is equivalent to
SkScalar r = h.length(); SkScalar r_inv = r ? SkScalarInvert(r) : 0; h.scale(r_inv); G->setSinCos(-h.fY, h.fX);
but has better numerical stability by using (partial) hypot, and saves a multiply by not computing r.
Definition at line 14 of file SkMatrix22.cpp.