This repository has been archived on 2024-12-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2024CG-project-render/include/triangle_area_normal.h
github-classroom[bot] 5985bb8445
Initial commit
2024-10-24 10:26:51 +00:00

18 lines
639 B
C

#ifndef TRIANGLE_AREA_NORMAL_H
#define TRIANGLE_AREA_NORMAL_H
#include <Eigen/Core>
// Compute the normal vector of a 3D triangle given its corner locations. The
// output vector should have length equal to the area of the triangle.
//
// Inputs:
// a 3D position of the first corner as a **row vector**
// b 3D position of the second corner as a **row vector**
// c 3D position of the third corner as a **row vector**
// Returns the area normal of the triangle as a 3D row vector
Eigen::RowVector3d triangle_area_normal(
const Eigen::RowVector3d & a,
const Eigen::RowVector3d & b,
const Eigen::RowVector3d & c);
#endif