Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:sdksamples:barycentric [2015/09/14] (current)
Line 1: Line 1:
 +====== Barycentric coordinates of a Quad ======
 +> **Developer:​** //​[[developer:​cplusplusplugins|C++]]//​
 +> **Summary:​** //Discusses the calculation of barycentric coordinates.//​
  
 +===== Question =====
 +Are there any solutions for finding the barycentric coordinates of a given point in a quad other than splitting that quad into two triangles?
 +
 +===== Answer =====
 +In general, for four points forming a convex quad and a point P in the quad,  there is not a unique solution to the problems:
 +
 +<​code>​
 +P = (a * A) + (b * B) + (c * C) + (d * D)
 +
 +where:
 +
 +a + b + c + d = 1
 +a, b, c, d >= 0
 +</​code>​
 +
 +So the concept of barycentric coordinates does not make sense when  there are more than three corner points. ​
 +
 +\\
 +
 +{{tag>​Developer cplusplus}}
developer/sdksamples/barycentric.txt ยท Last modified: 2015/09/14 (external edit)