diff options
author | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-05 02:02:05 +0000 |
---|---|---|
committer | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-05 02:02:05 +0000 |
commit | 8ae714b186ae5f4eaddee239281fbfe7282320c9 (patch) | |
tree | 3ebb325b01f382ff46b3563a1603f8e74597ec65 /experimental | |
parent | ac0d47ecb80fcedf704b9daf9506ec09e39e7f9c (diff) |
Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@7038 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental')
-rw-r--r-- | experimental/Intersection/CubicToQuadratics.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/experimental/Intersection/CubicToQuadratics.cpp b/experimental/Intersection/CubicToQuadratics.cpp index e3b97ffb79..7cea4d441c 100644 --- a/experimental/Intersection/CubicToQuadratics.cpp +++ b/experimental/Intersection/CubicToQuadratics.cpp @@ -3,7 +3,7 @@ http://stackoverflow.com/questions/2009160/how-do-i-convert-the-2-control-points */ /* -Let's call the control points of the cubic Q0..Q3 and the control points of the quadratic P0..P2. +Let's call the control points of the cubic Q0..Q3 and the control points of the quadratic P0..P2. Then for degree elevation, the equations are: Q0 = P0 @@ -25,11 +25,11 @@ Cubic defined by: P1/2 - anchor points, C1/C2 control points |x| is the euclidean norm of x mid-point approx of cubic: a quad that shares the same anchors with the cubic and has the control point at C = (3·C2 - P2 + 3·C1 - P1)/4 - + Algorithm pick an absolute precision (prec) -Compute the Tdiv as the root of (cubic) equation +Compute the Tdiv as the root of (cubic) equation sqrt(3)/18 · |P2 - 3·C2 + 3·C1 - P1|/2 · Tdiv ^ 3 = prec if Tdiv < 0.5 divide the cubic at Tdiv. First segment [0..Tdiv] can be approximated with by a quadratic, with a defect less than prec, by the mid-point approximation. |