<commit_before>#include "node/solid/triangle.h"

namespace Svit
{
	Triangle::Triangle (Point3 _p1, Point3 _p2, Point3 _p3)
	  : p1(_p1), p2(_p2), p3(_p3)
	{
		Vector3 e1= p2 - p1;
		Vector3 e2 = p3 - p1;
		normal = ~(~e1 & ~e2);
	}

	boost::optional<Intersection>
	intersect (Ray& _ray, float _best)
	{
		float d = _ray.direction % normal;
		if (d == 0.0f)
			return boost::optional<Intersection>();

		float a = (_ray.origin - p1) % normal;
		float t = -a/d;
		if (t < 0.0001f || t > _best)
			return boost::optional<Intersection>();

		Point3 surface_point = _ray(t);

		Vector3 e1 = p2 - p1;
		Vector3 e2 = p3 - p1;
		Vector3 u  = e1 & e2;
		float area = sqrtf(u % u);

		Vector3 e11 = surface_point - p1;
		Vector3 e12 = p3 - p1;
		Vector3 u1  = e11 & e12;
		float area1 = sqrtf(u1 % u1);

		Vector3 e21 = p2 - surface_point;<commit_msg>Whitespace fix<commit_after>#include "node/solid/triangle.h"

namespace Svit
{
	Triangle::Triangle (Point3 _p1, Point3 _p2, Point3 _p3)
	  : p1(_p1), p2(_p2), p3(_p3)
	{
		Vector3 e1 = p2 - p1;
		Vector3 e2 = p3 - p1;
		normal = ~(~e1 & ~e2);
	}

	boost::optional<Intersection>
	intersect (Ray& _ray, float _best)
	{
		float d = _ray.direction % normal;
		if (d == 0.0f)
			return boost::optional<Intersection>();

		float a = (_ray.origin - p1) % normal;
		float t = -a/d;
		if (t < 0.0001f || t > _best)
			return boost::optional<Intersection>();

		Point3 surface_point = _ray(t);

		Vector3 e1 = p2 - p1;
		Vector3 e2 = p3 - p1;
		Vector3 u  = e1 & e2;
		float area = sqrtf(u % u);

		Vector3 e11 = surface_point - p1;
		Vector3 e12 = p3 - p1;
		Vector3 u1  = e11 & e12;
		float area1 = sqrtf(u1 % u1);

		Vector3 e21 = p2 - surface_point;
{'fraction_non_alphanumeric': 0.1496437054631829, 'fraction_numerical': 0.07600950118764846, 'mean_word_length': 3.002375296912114, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4304043', 'n_tokens_mistral': 816, 'n_tokens_neox': 730, 'n_words': 188}