Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

280
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!