<commit_before>#ifndef M_PLANE_HDR
#define M_PLANE_HDR
#include "m_vec.h"

namespace m {

struct quat;
struct perspective;

struct plane {
    enum point {
        kBack,
        kOn,
        kFront
    };

    plane() = default;
    plane(const m::vec3 &p1, const m::vec3 &p2, const m::vec3 &p3);
    plane(const m::vec3 &pp, const m::vec3 &nn);

    bool intersect(float &f, const m::vec3 &p, const m::vec3 &v) const;

    float distance(const m::vec3 &p) const;
    point classify(const m::vec3 &p, float epsilon = kEpsilon) const;

    vec3 n;
    float d;
};

inline plane::plane(const m::vec3 &p1, const m::vec3 &p2, const m::vec3 &p3)
    : n(((p2 - p1) ^ (p3 - p1)).normalized())
    , d(-n * p1)
{
}
<commit_msg>plane distance not initialized when using default constructor<commit_after>#ifndef M_PLANE_HDR
#define M_PLANE_HDR
#include "m_vec.h"

namespace m {

struct quat;
struct perspective;

struct plane {
    enum point {
        kBack,
        kOn,
        kFront
    };

    plane();
    plane(const m::vec3 &p1, const m::vec3 &p2, const m::vec3 &p3);
    plane(const m::vec3 &pp, const m::vec3 &nn);

    bool intersect(float &f, const m::vec3 &p, const m::vec3 &v) const;

    float distance(const m::vec3 &p) const;
    point classify(const m::vec3 &p, float epsilon = kEpsilon) const;

    vec3 n;
    float d;
};

inline plane::plane()
    : d(0.0f)
{
}

inline plane::plane(const m::vec3 &p1, const m::vec3 &p2, const m::vec3 &p3)
    : n(((p2 - p1) ^ (p3 - p1)).normalized())
    , d(-n * p1)
{
}

{'fraction_non_alphanumeric': 0.15450361604207757, 'fraction_numerical': 0.03287310979618672, 'mean_word_length': 3.047872340425532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4835502', 'n_tokens_mistral': 614, 'n_tokens_neox': 597, 'n_words': 167}