Code:
void plotNeedle(int Lvalue, int Rvalue, byte ms_delay)
{
tft.writeRect(0, 0, vu.width, vu.height, (uint16_t*)(vu.pixel_data));
float Rdeg = map(Rvalue, 0, 220, 57, 123); // Netto 220px avaiable for display graph x axis
int Rx = 160 + 193 * cosf(Rdeg * 0.0174532925f);
int Ry = -115 + 193 * sinf(Rdeg * 0.0174532925f);
// tft.drawLine(160, -115, Rx-1, Ry, ILI9341_RED);
// tft.drawLine(160, -115, Rx, Ry, ILI9341_MAGENTA);
// tft.drawLine(160, -115, Rx+1, Ry, ILI9341_RED);
tft.drawLine(Rx + 115 * tanf((Rdeg + 90) * 0.0174532925f), 0, Rx-1, Ry, ILI9341_RED);
tft.drawLine(Rx + 115 * tanf((Rdeg + 90) * 0.0174532925f), 0, Rx, Ry, ILI9341_MAGENTA);
tft.drawLine(Rx + 115 * tanf((Rdeg + 90) * 0.0174532925f), 0, Rx+1, Ry, ILI9341_RED);
float Ldeg = map(Lvalue, 0, 220, 303, 235); // Netto 220px avaiable for display graph x axis
int Lx = 160 + 193 * cosf(Ldeg * 0.0174532925f);
int Ly = 115 + 240 + 193 * sinf(Ldeg * 0.0174532925f);
// tft.drawLine(160, 240 + 115, Lx-1, Ly, ILI9341_RED);
// tft.drawLine(160, 240 + 115, Lx, Ly, ILI9341_MAGENTA);
// tft.drawLine(160, 240 + 115, Lx+1, Ly, ILI9341_RED);
tft.drawLine(Lx - 115 * tanf((Ldeg - 90) * 0.0174532925f), 240, Lx-1, Ly, ILI9341_RED);
tft.drawLine(Lx - 115 * tanf((Ldeg - 90) * 0.0174532925f), 240, Lx, Ly, ILI9341_MAGENTA);
tft.drawLine(Lx - 115 * tanf((Ldeg - 90) * 0.0174532925f), 240, Lx+1, Ly, ILI9341_RED);
if (Rvalue > 174) tft.fillCircle(160, 22,7,ILI9341_RED);
if (Lvalue > 174) tft.fillCircle(160,218,7,ILI9341_RED);
}