View Single Post
  #4  
Old 07-29-2022, 08:41 PM
devilsclaw is offline devilsclaw
Registered User

Join Date: Nov 2002
Posts: 76

The math for this is:
output = ((360 - ((input - 90) % 360)) % 360)

librecalc example:
Code:
=MOD(360 - MOD(A1 - 90,360), 360)
C Source code
Code:
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>

int main(int argc, char** argv) {
  int in = strtoul(argv[1], 0, 10);
  int out = 0;

  out = (360 - ((in - 90) % 360)) % 360;
  printf("in %i : out %i\n", in, out);

// Test code
//  for(in = 0; in < 360; in++) {
//    out = (360 - ((in - 90) % 360)) % 360;
//    printf("%i,%i\n", in, out);
//  }
}
I did not have this before I made it from looking at your table
Reply With Quote