barycentric coordinate to Cartesian coordinate

The Cartesian coordinates of a point can be calculated as a linear combination with barycentric coordinates as coefficients:

Vector3d Tri::cartesian(const Vector3d& barycentric) const
{
      return barycentric.x * p0 + barycentric.y * p1 + barycentric.z * p2;
}

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s