#include <stdio.h>
#include <math.h>

// as per /files/programming/c/abspos.dxf

#define d2r(A)  (A)*(M_PI/180)
#define r2d(A)  (A)*(180/M_PI)

#define ABC (ABR+CBR)
#define ABR 30.162
#define ACB (BCR+ACR)
#define ACR 28.552
#define ARB 123.374
#define ARC 129.028 

#define BAC (RAC+RAB)
#define BAR 26.465 
#define BCR 38.415
#define BRC 107.598

#define CAR 22.42
#define CBR 33.987

#define AB  81.781
#define BC  66.95
#define AC  80.019

int main(void) {
  
  float D, M, acr;
  
  // get that dasterdly angle
  D = d2r( ABC + BRC + ACB - 180 );
  M = (AC/AB) * (sin(d2r(ARB))/sin(d2r(ARC)));
  acr = r2d(atan(sin(D)/(M + cos(D))));
  
  
  printf("ACR = %f = acr = %f\n", ACR, acr);
  
  
  //were gonna make some new triangles that are easier to work with
  // by creating a fake point A that is on the same Y as C
  // then we will use pythag to get the position
  // 
  

  return (0);
}
