<commit_before>#pragma once

#include <cmath>
#include <iostream>

#include "global_config.hpp"
#include "constants.hpp"

namespace mocc {
    inline real_t RadToDeg( real_t rad ) {
        return 180*(rad*RPI);
    }

    struct Angle {
        /// x-component of the angle
        real_t ox;
        /// y-component of the angle
        real_t oy;
        /// z-component of the angle
        real_t oz;
        /// azimuthal angle
        real_t alpha;
        /// polar cosine
        real_t theta;
        /// quadrature weight
        real_t weight;
        /// Reciprocal of the sine of the polar angle. This is useful for
        /// computing true ray segment length from 2D projected length.
        real_t rsintheta;

        // Construct using alpha/theta
        Angle( real_t alpha, real_t theta, real_t weight ):
            alpha(alpha),
            theta(theta),
            weight(weight)
        {
            ox = sin(theta)*cos(alpha);
            oy = sin(theta)*sin(alpha);
            oz = cos(theta);
        }

        // Construct using direction cosines
        Angle( real_t ox, real_t oy, real_t oz, real_t weight):
            ox(ox), oy(oy), oz(oz), weight(weight)
        {
            theta = acos(oz);
            alpha = acos(ox/sin(theta));
            rsintheta = 1.0/sin(theta);
        }
        
        // Provide stream insertion support
        friend std::ostream& operator<<(std::ostream& os, const Angle &ang ) {
            os << RadToDeg(ang.alpha) << "\t" << RadToDeg(ang.theta) << "\t"
               << ang.ox << "   \t" << ang.oy << "   \t" << ang.oz << "   \t"
               << ang.weight;
            return os;
        }

    };
    
    Angle ToOctant( Angle in, int octant );

    Angle ModifyAlpha ( Angle in, real_t new_alpha );

    
}<commit_msg>Add a default constructor for Angle<commit_after>#pragma once

#include <cmath>
#include <iostream>

#include "global_config.hpp"
#include "constants.hpp"

namespace mocc {
    inline real_t RadToDeg( real_t rad ) {
        return 180*(rad*RPI);
    }

    struct Angle {
        /// x-component of the angle
        real_t ox;
        /// y-component of the angle
        real_t oy;
        /// z-component of the angle
        real_t oz;
        /// azimuthal angle
        real_t alpha;
        /// polar cosine
        real_t theta;
        /// quadrature weight
        real_t weight;
        /// Reciprocal of the sine of the polar angle. This is useful for
        /// computing true ray segment length from 2D projected length.
        real_t rsintheta;

        /**
         * Default constructor makes a nonsense angle. Watch out.
         */
        Angle() {}

        /** 
         * Construct using alpha/theta
         */
        Angle( real_t alpha, real_t theta, real_t weight ):
            alpha(alpha),
            theta(theta),
            weight(weight)
        {
            ox = sin(theta)*cos(alpha);
            oy = sin(theta)*sin(alpha);
            oz = cos(theta);
        }

        /**
         * Construct using direction cosines
         */
        Angle( real_t ox, real_t oy, real_t oz, real_t weight):
            ox(ox), oy(oy), oz(oz), weight(weight)
        {
            theta = acos(oz);
            alpha = acos(ox/sin(theta));
            rsintheta = 1.0/sin(theta);
        }
        
        // Provide stream insertion support
        friend std::ostream& operator<<(std::ostream& os, const Angle &ang ) {
            os << RadToDeg(ang.alpha) << "\t" << RadToDeg(ang.theta) << "\t"
               << ang.ox << "   \t" << ang.oy << "   \t" << ang.oz << "   \t"
               << ang.weight;
            return os;
        }

    };
    
    Angle ToOctant( Angle in, int octant );

    Angle ModifyAlpha ( Angle in, real_t new_alpha );

    
}
{'fraction_non_alphanumeric': 0.11845222426954462, 'fraction_numerical': 0.0031587259805211897, 'mean_word_length': 1.5316455696202531, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 7, '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': '82987', 'n_tokens_mistral': 1192, 'n_tokens_neox': 1129, 'n_words': 320}