<commit_before>#include <stdio.h>
#include <math.h>
#include <gps.h>
//note: seikei toukei ni izon
static const double target_latitude = 35.7133352;//ido
static const double target_longitude = 139.7599809;//keido
static const double PI = 3.14159265;
static const double EARTH_RADIUS = 6378137;
//構造体で角度と距離返す方がいいかもしれない
loc_t data;

typedef struct cartesian_coordinates{
  double x;
  double y;
  double z;
}cartesian_coord

int mitibiki_initializer()
{
  gps_init();
}

double calc_angle(double lat,double lon)
{
  double lat_offset = target_latitude - lat;
  double lon_offset = target_longitude - lon;
  double angle = atan2(-lon_offset,-lat_offset)*(180/PI) + 180;
  printf("target_angle : %f\n",angle);
  return angle;
}

double target_angle()
{
  gps_location(&data);
  printf("latitude:%f, longitude:%f\n", data.latitude, data.longitude);
  double target_angle = calc_angle(data.latitude,data.longitude);
  return target_angle;
}

cartesian_coord latlng_to_xyz(double lat,double lon)
{
  double rlat = lat*PI/180;
  double rlon = lon*PI/180;
  double coslat = cos(rlat);
  cartesian_coord tmp;<commit_msg>debug Please enter the commit message for your changes. Lines starting<commit_after>#include <stdio.h>
#include <math.h>
#include <gps.h>
//note: seikei toukei ni izon
static const double target_latitude = 35.7133352;//ido
static const double target_longitude = 139.7599809;//keido
static const double PI = 3.14159265;
static const double EARTH_RADIUS = 6378137;
//構造体で角度と距離返す方がいいかもしれない
loc_t data;

typedef struct cartesian_coordinates{
  double x;
  double y;
  double z;
}cartesian_coord;

int mitibiki_initializer()
{
  gps_init();
  return 0;
}

double calc_angle(double lat,double lon)
{
  double lat_offset = target_latitude - lat;
  double lon_offset = target_longitude - lon;
  double angle = atan2(-lon_offset,-lat_offset)*(180/PI) + 180;
  printf("target_angle : %f\n",angle);
  return angle;
}

double target_angle()
{
  gps_location(&data);
  printf("latitude:%f, longitude:%f\n", data.latitude, data.longitude);
  double target_angle = calc_angle(data.latitude,data.longitude);
  return target_angle;
}

cartesian_coord latlng_to_xyz(double lat,double lon)
{
  double rlat = lat*PI/180;
  double rlon = lon*PI/180;
  double coslat = cos(rlat);
  cartesian_coord tmp;
{'fraction_non_alphanumeric': 0.11397379912663755, 'fraction_numerical': 0.042358078602620086, 'mean_word_length': 5.060846560846561, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '851655', 'n_tokens_mistral': 932, 'n_tokens_neox': 856, 'n_words': 199}