Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

290
Visualizações
How to calculate rotation angle from proportion of two values?

There is a couple of indicators that shows kill/death and dealt/received damage on this page. There is no client-side JavaScript function that would calculate the rotation angle for arrows on them, only the one that converts transform: rotate(); property to legacy IE's DXImage thing.

The initial position of both arrows (when ratio is 1) is 0°, the leftmost is -30° (ratio is 0), the rightmost is 30° (ratio is 2), but this is applicable to the first (kill/death) indicator.

The right one is complicated, as it may have variable lowest and highest values. I'm probably wrong on that, here are more examples — one, two, three.

I have attempted calculating the rotation angle for the left indicator using the formulas from this React application, but it uses 180° scale while I have 60° with start point not being at leftmost position.

Providing code-way solution of the problem is not essential, I'm looking for math-way solution which I'll adapt to language I use on my backend, but if you wish so, I'll accept answers in PHP, JS or Python 3.x syntax.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda