<commit_before>/**
 * \file qibla.cpp
 */
#include <math.h>

double get_qibla_angle(double longitude, double latitude)
{
    double m = sin(longitude - 39.8230);
    double n = cos(latitude) * tan(21.42330) - sin(latitude) * cos(longitude - 39.8230);
    double q = atan(m/n);
    return q;
}<commit_msg>use constants while calculating qibla<commit_after>/**
 * \file qibla.cpp
 */
#include <math.h>

static const double DEG2RAD = 0.017453292519943295769236907684886;
static const double MECCA_LONGITUDE = 39.8230*DEG2RAD; // 39.8230E
static const double MECCA_LATITUDE = 21.42330*DEG2RAD; // 21.42330N
double get_qibla_angle(double longitude, double latitude)
{
    double m = sin(longitude*DEG2RAD - MECCA_LONGITUDE);
    double n = cos(latitude*DEG2RAD) * tan(MECCA_LATITUDE) - sin(latitude*DEG2RAD) * cos(longitude*DEG2RAD - MECCA_LONGITUDE);
    double q = atan(m/n) / DEG2RAD;
    return q;
}
{'fraction_non_alphanumeric': 0.12806236080178174, 'fraction_numerical': 0.09688195991091314, 'mean_word_length': 4.226744186046512, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6566478', 'n_tokens_mistral': 426, 'n_tokens_neox': 355, 'n_words': 74}