Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Maths, help me with answer - changing one calculation into another

Author
Message
fallen one
17
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 17th Mar 2014 11:23
I want to work out how to alter one set of equations for a unit conversion program into another. So that I can change the other ones units of calculation to be the same as the first

Here is the maths for the original
<option value="((0.000016387064*231)/128)/8">dram</option>
maths the other program uses
<option value="0.45359237/256">dram</option>

What maths would I do to change the second calculation figure into the first?

Any help greatly appreciated.


Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Mar 2014 11:58
I've no idea what you're trying to do there. Those are just two different formulae giving different values. What's supposed to be the connection between them? Units of what? What units?

And why would you want to hard code a cumbersome formula like ((0.000016387064*231)/128)/8 instead of using its value, such as 0.00000369669120 or 3.69669120E-06 ?



Powered by Free Banners
fallen one
17
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 17th Mar 2014 13:18
They are units if measure, in this case drams. Both are the same unit of measure, but they are using different calculations.

They are from 2 different programs, both programs convert one unit of measure into other units of measure. For example
milliliters
teaspoons
kilograms
The programs converts from one unit, into another unit, so you enter a number to convert, pick a unit
lets say kilogram then a unit to convert into lets say teaspoons and it would tell you how many teaspoons the unit in kilograms was.

I want to add new units to the original calculator that it doesn't have, but the other program does, I thought if I could work out the equation that the second calculator uses, I could add its units of measure into my own, so I posted the maths that's in the SAME unit of measure for both of them, if one can work out how to change the formula of the second one so its the same as the first, then I can use units of measure from from the second calculator by converting them add them to the original calculator.


Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Mar 2014 16:29
But what are you converting from what to what? Those numbers mean nothing till you refer to specific measurement units, e.g. litres to pints, cm to inches, kg to lb, etc, etc.

So, in your case, both calculations are called "dram" but where's the conversion? What is being converted to or from "drams" in the two cases? Can't be the same because the expressions evaluate to different things.



Powered by Free Banners
nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 17th Mar 2014 19:31 Edited at: 17th Mar 2014 19:34
You're saying: Here are two cats. Here's how to convert to dogs with a cat:
cat = 0.5dogs
here's how the other cat converts:
cat = 0.75dogs
So how can I convert it so I can make cats the same?

There's an answer which is universal in standard mathematics: Whatever you're trying to convert, get the value of a single unit in the target unit. There, simple.
How many kgs in a dram? 123.45
Cool so 2 drams = (123.45x2)kgs.
Or I'm completely missing it because I'm tired.

Maybe post the target unit and the source unit. If one is hypothetical then you need at least one converted value, eg: 12.78 drams = 10.42 horses. Even that just boils down to 1 horse = 12.78/10.42 drams.



You're a bad man!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Mar 2014 22:12
Quote: "You're saying: Here are two cats. Here's how to convert to dogs with a cat:
cat = 0.5dogs
here's how the other cat converts:
cat = 0.75dogs
So how can I convert it so I can make cats the same?"


With those figures I suspect you're talking about our two cats - especially if the dog in question is a St Bernard.



Powered by Free Banners
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Mar 2014 19:43
Quote: "milliliters
teaspoons
kilograms"


Well, milliliters measures volume, kilograms measures weight. How do you expect to convert these?


Separating the two different types, I'll use weight as an example. Pick a common denomination. Whatever the measurement of weight is, convert it to kilograms first. Then, convert the kilograms to the target conversion type. It's a two step conversion process but makes things very easy.


Lookup table (weight):
1lb = 0.4535924 kg
1oz = 0.0283495 kg
1t = 907.185 kg
1g = 0.001 kg

Lookup table (volume):
1mL = 0.001 L
1gal = 3.78541 L
1qt = 0.946353 L
1cup = 0.236588 L


You would have a similar lookup table to match up going in the opposite direction. So for weight, our base unit of measure in kilograms. So map out how many pounds, ounces, tons, grams are in 1kg.


Teaspoon conversion is tricky, because apparently a teaspoon is a different size in US and UK. And for weight you have the short ton, metric ton, and long ton. (ugh!)

Kezzla
15
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 18th Mar 2014 21:02 Edited at: 19th Mar 2014 06:54
wrote this before reading Phalax say the same thing first




on another note, Phalax, I thought your signature was a real add for a second. I had a real wtf moment.

To Err is Human...
To Arr is Pirate!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Mar 2014 22:11
Quote: "Phalax, I thought your signature was a real add for a second. I had a real wtf moment."

lol. If anyone finds it offensive, I'll remove it. Until then, I'll enjoy its subtle amusement.

easter bunny
11
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 19th Mar 2014 00:58
I found it hilarious

Kezzla
15
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 19th Mar 2014 06:55
It is funny, I was momentarily shocked by the marketing angle.

To Err is Human...
To Arr is Pirate!
nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 19th Mar 2014 08:36
I missed it until I turned images on, in my browser.



You're a bad man!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Mar 2014 18:59
Quote: "I missed it until I turned images on, in my browser."


You must be missing a lot.



Powered by Free Banners
nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 20th Mar 2014 07:08
Yep, I missed the entire PS3 gaming era sans the few hours I spent on my best friend's console. I still think of games mainly in 2D and early PS1 3D. 90s-syndrome. Sure 2000s had some good games but the elusive "magic" was gone. About the only thing that significantly improved in the 2000s was anime but the overuse of CGI was like a wrecking ball through it. Now they finally have unobtrusive CGI, it's killing the hand-drawn stuff. Not to say that it's much of a loss. So many generic things these days -- much like the gaming industry. It's sad these days that in an era where we finally have all the choice, we have to wade through so much [would be mod-editted] to utilize it.
Oops, this is not the posting competition. Well I typed it, I may as well post it. OP ain't responding so it's abandoned or he got his answer.



You're a bad man!
Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 20th Mar 2014 22:45
Quote: "Oops, this is not the posting competition."
Lol, I was getting a little confused, glancing back and forth between the page title and your post. Fine insight though!

fallen one
17
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 21st Mar 2014 15:55 Edited at: 21st Mar 2014 15:55
I hired someone to do it for me, hope its delivered by today, last spoken update was a rather odd question, so its anyone's guess till I hear back.


nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 21st Mar 2014 18:44
Hope it's COD then. You don't wanna fork out cash until you have a working product. Well good luck in any case.


You're a bad man!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Mar 2014 23:19
I could've made this for you for free in like an hour.

fallen one
17
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 22nd Mar 2014 13:56 Edited at: 22nd Mar 2014 18:06
I dont think this can be done, well it can, but requires a re think, one lot of units are volume the other are weight, so it will have to be done with weight per volume calculation. Ill do that in the future because it will require an UI change.


Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Mar 2014 07:24
Tried to do this before I left town for the weekend, but didn't have time until tonight.

http://zimnox.com/convert.php

Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 12th Apr 2014 09:21
Math*

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 12th Apr 2014 15:37
Ermmmmm no. Mathematics therefore maths.


They see me coding, they hating. http://indi-indicium.blogspot.co.uk/
Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 12th Apr 2014 23:01
Mathematics is singular. It's a practice like physics, hence the s. Therefore math.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Apr 2014 00:33 Edited at: 13th Apr 2014 00:34
If you do your sums right you're doing your maths right. Plural.

Edit On the other hand this thread got off to a debatable start:

Quote: "Here is the maths for the original"




Powered by Free Banners
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Apr 2014 01:15
I think only ppl in the UK say "maths". Say that in the US and we look at you funny.

Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 13th Apr 2014 01:41
Same here in Canada.

Seditious
10
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 13th Apr 2014 01:45
So has anyone figured this out yet? Since I have a physic question.

Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 13th Apr 2014 01:50
"Phys" is short for physics at my university.

Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 14th Apr 2014 01:01
'Math' and 'maths' are both completely valid and grammatically correct forms of the word, and both can be used in a singular or plural context, just as 'fish', for example, can be.

Seditious
10
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 14th Apr 2014 02:38
no
Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 14th Apr 2014 10:29 Edited at: 14th Apr 2014 10:31
You look really stupid and arrogant when you leave a lazily short winded comment like 'no'.

There is one error in my above post: 'maths' is, in fact, only plural. Can't be singular. At least, as far as I know. But, maths is indeed a completely valid form of the word. This thread's title is correct, too. I digress.

Login to post a reply

Server time is: 2024-04-25 17:03:25
Your offset time is: 2024-04-25 17:03:25