Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: experimental/Intersection/TriangleUtilities.cpp

Issue 867213004: remove prototype pathops code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/Intersection/TriangleUtilities.h ('k') | experimental/Intersection/as.htm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/Intersection/TriangleUtilities.cpp
diff --git a/experimental/Intersection/TriangleUtilities.cpp b/experimental/Intersection/TriangleUtilities.cpp
deleted file mode 100644
index 98893680790dad623b44459e97e856a129a4129a..0000000000000000000000000000000000000000
--- a/experimental/Intersection/TriangleUtilities.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "TriangleUtilities.h"
-
-// http://www.blackpawn.com/texts/pointinpoly/default.html
-bool pointInTriangle(const Triangle& triangle, const _Point& pt) {
-// Compute vectors
- _Vector v0 = triangle[2] - triangle[0];
- _Vector v1 = triangle[1] - triangle[0];
- _Vector v2 = pt - triangle[0];
-
-// Compute dot products
- double dot00 = v0.dot(v0);
- double dot01 = v0.dot(v1);
- double dot02 = v0.dot(v2);
- double dot11 = v1.dot(v1);
- double dot12 = v1.dot(v2);
-
-// Compute barycentric coordinates
- double invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
- double u = (dot11 * dot02 - dot01 * dot12) * invDenom;
- double v = (dot00 * dot12 - dot01 * dot02) * invDenom;
-
-// Check if point is in triangle
- return (u >= 0) && (v >= 0) && (u + v < 1);
-}
« no previous file with comments | « experimental/Intersection/TriangleUtilities.h ('k') | experimental/Intersection/as.htm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698