|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
|
I need some maths help guys
Hiya guys,
Little maths question for ya, if anyone can work this out then they deserve a medal, either that or it's just me being really thick again ![]() A program i'm working on needs an analogue gauge and a digital representation of the gauges reading (which is gonna be in a text box under the gauge). The number being inputted ranges from 0-255 and if compared to the actual then input of 0 would give an output of -20, an input of 255 would give an output of +20 and an input of 126.5 would give an output of 0. I think i've explained that as best i can. so input of 0 = screen reading of -20 and input of 255 = screen reading of +20. Any ideas on the maths involved?
__________________
Intel Core i7 920 2.66GHz | Asus P6T SE| 6GB Corsair ram | XFX Radeon HD 4780 | 2 x 250 Gb Maxtor SATA II (in RAID 0), 1 x 250GB SATA II | Creative XFI soundcard | Coolermaster 650W PSU | ThermalTake Tsunami case My new website -Carp Fishing Forums |
|
|
|
|
|
#2 |
|
Staff
Premium Member
Join Date: Sep 2004
Location: Cardiff, Wales. UK
Posts: 6,105
|
Where 0 = -20 and 255 = +20 every increment of 1 in the range 0 to 255 is equivalent to an increase in value of 0.15686 in the range -20 to +20
__________________
Niwa no niwa ni wa, niwa no niwatori wa niwaka ni wani o tabeta. |
|
|
|
|
|
#3 |
|
Member (9 bit)
Join Date: Nov 2004
Location: Flint, MI
Posts: 256
|
Yes, rjfvillarosa is right. Each one between 0-255 would represent .15686 of whatever. By the time that you reached 255 it would virtually come out to 40, or the spread of -20 to 20.
^fo |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|