#include int map(int x, int x1, int x2, int y1, int y2){ return (int)((float)(y1) + (float)(y2-y1)/(float)(x2-x1)*(float)(x-x1)); } int main(void){ const int xLinks=0xdb8; const int xRechts=0x900; const int yLinks=100; const int yRechts=1500; printf("\n Wertetabelle"); for(int x=xLinks; x>=xRechts; x-=50){ printf("\n0x%04x %5d", x, map(x, xLinks, xRechts, yLinks, yRechts)); } } ************************************************************************ Wertetabelle 0x0db8 100 0x0d86 157 0x0d54 215 0x0d22 273 0x0cf0 331 0x0cbe 389 0x0c8c 447 0x0c5a 505 0x0c28 563 0x0bf6 621 0x0bc4 679 0x0b92 737 0x0b60 795 0x0b2e 853 0x0afc 911 0x0aca 969 0x0a98 1027 0x0a66 1085 0x0a34 1143 0x0a02 1200 0x09d0 1258 0x099e 1316 0x096c 1374 0x093a 1432 0x0908 1490