Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

289
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda